1

I'm using the existing form from the default login page and calling the action like this:

<?php $custmlogin= new Mage_Customer_Block_Form_Login();?> <form action="<?php echo $custmlogin->getPostActionUrl() ?>"...

The action gets echoed just fine resulting in the same path I initially had hard coded, but it doesn't actually log me in. I just goes to the standard login page with a form for me to log in. Is there something else I need to do to actually submit the data and get logged in successfully?

2

2 Answers 2

1

Mage_Customer_AccountController (/app/code/core/Mage/Customer/controllers/AccountController.php) handles login functionality, use it's url:

<form action="<?=Mage::getUrl('customer/account/login', array('_secure' => true))?>">
1
  • thank you for the response.I tried it and it's just echoing the same path as I had before using the variable and hard coding it in. So I end up with the same result. It obviously echoed: customer/account/login and the getUrl just puts the domain in front of it. I've tried it multiple ways, but no luck :/
    – stinkysGTI
    Commented Jan 29, 2014 at 2:34
1

I finally got it using this:

{{block type ="Mage_Customer_Block_Form_login" template="customer/form/login.phtml" }}

Instead of pulling in my own custom block. Not really sure what the difference was until I looked at the source code and noticed there was a slight difference in the action attribute.

mageUz's answer was very close. So instead of this:

<?=Mage::getUrl('customer/account/login', array('_secure' => true))?>

it was:

<?=Mage::getUrl('customer/account/loginPost', array('_secure' => true))?>

All it needed was Post added to it. Then I removed the Mage block and just kept mine in there.


Thank you guys for the help and putting me in the right direction.

1
  • I tried, but it said I have to wait till tomorrow. I will as soon as I can though.
    – stinkysGTI
    Commented Jan 29, 2014 at 20:26

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.