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 = "[email protected]";

                $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 = "[email protected]";

                $mail = Mage::getModel('core/email');
                $mail->setToName('Your Name');
                $mail->setToEmail(array($to,'[email protected]'));
                $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

1 Answer 1


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">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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