A Magento 1.9 website worked perfectly with PHP 5.6.40, but the server (which I don't have access to) was upgraded to PHP 7.1 and the custom contact forms stopped working.

It does not give any error, however, the action of the form is not done correctly and redirects to a Login page that I have never seen. It was to send an email and redirect to a pdf.

Does anyone know what can it be?

The module that no longer works:


class Empresa_Liga_IndexController extends Mage_Core_Controller_Front_Action
    public function indexAction()

    public function postAction()
        $post = $this->getRequest()->getPost();

        if ($post){
            try {
                $name = $post["name"];
                $telefone = $post["telefone"];
                $email = $post["email"];
                $ddd = substr($telefone, 0, 2);

                $to = "comercial@empresa.com.br";

                $subject = "Novo Contato";
                $body .= "<p>Novo contato pelo formulario: 'A empresa liga pra você'</p>";
                $body .= "<p>Nome : " . $name . "</p>";
                $body .= "<p>Telefone  : " . $telefone . "</p>";
                $body .= "<p>Email  : " . $email . "</p>";

                $from = "empresa@gmail.com";

                $mail = Mage::getModel('core/email');
                $mail->setToName('Your Name');
                $mail->setType('html');// YOu can use Html or text as Mail format
                $mail->setBodyHTML(utf8_decode($body));  // your content or message


                Mage::getSingleton('core/session')->addSuccess('Sua solicitação foi enviada... Em breve entraremos em contato');
            } catch (Exception $e) {
                Mage::getSingleton('core/session')->addError('Ocorreu um erro, tente novamente mais tarde');
        } else {


<?xml version="1.0"?>


class Empresa_Liga_Helper_Data extends Mage_Core_Helper_Abstract

It was actually quite simple, I don't know why it wasn't a problem before. I found the solution here:


in the html of my form it was like this:

<form action = "/empresa-liga/index/post" id ="brochureform" method = "post">

I switched to

<form action = "/empresa-liga/index/post/" id = "brochureform" method = "post">

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.