Solved

Mini login form not working

Posted on 2013-01-04
11
1,272 Views
Last Modified: 2016-03-02
Happy new year guys!

I was wondering if someone could help me with a problem I'm having with a mini login form for Magento. I've been looking into my code for hours and could do with a fresh pair of eyes...

The problem is that the form isn't

a) posting for users to login

b) directing to the create account URL when the "create an account" button is clicked

c) Isn't directing to the forgot your password URL when "forgot password" is clicked

I wondering if there is a setting that I may have changed as the same thing happens if I use the mini login form from the "base" template.

I've got no idea...

   <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
      <p>
      <input type="text" class="input-xlarge" name="login[username]" id="mini-login" placeholder="<?php echo $this->__('Email:') ?>"></p><p>
      <input type="password" class="input-xlarge" name="login[password]" id="mini-password" placeholder="<?php echo $this->__('Password:') ?>"></p>
   
      </div>
  <div class="modal-footer">
     <button type="button" title="<?php echo $this->__('Create an Account') ?>" class="btn btn-success pull-left" onclick="window.location='<?php echo $this->getCreateAccountUrl() ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
    <button type="submit" title="<?php echo $this->__('Login') ?>" class="btn btn-info pull-left"><span><span><?php echo $this->__('Login') ?></button>
    <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?>
      </a>
       </form>

Open in new window


Some help and a fresh pair of eyes will be a massive help
0
Comment
Question by:rafique12
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 7

Expert Comment

by:whosbetterthanme
ID: 38744675
For starters, can you look at (or post) what the actual rendered code in the browser has? You're showing the script before the server renders/parses it. What does the output HTML show?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38745460
Agreed.  Look at the "View Source" to see what is actually being generated.
0
 

Author Comment

by:rafique12
ID: 38745716
Thanks for the reply guys, basically all that happens is the page refreshes. The login box shows on first arrival to the site in a Modal. When any of the buttons are clicked it just refreshes the homepage.
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 38745993
Ok, but what is in the "View Source"?  I suspect this part action="<?php echo $this->getPostActionUrl() ?>"  is resulting in an empty value like action="" in the source that is sent to the browser.  Until you look, you don't know.  If you find that it is empty like I suspect, then you need to go find out why.
0
 
LVL 7

Expert Comment

by:whosbetterthanme
ID: 38746050
As we all agree, post the source.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 38746563
If you want to understand PHP client authentication, this article explains the design pattern.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html

At its simplest, a PHP session pointer is checked to see if the client is authentic. If the pointer does not indicate that the client is authenticated, then an HTML for is presented to receive the credentials.  If the received credentials are acceptable, the session pointer is set to indicate that the client is authentic,  Else, present the form again, etc.  

Since you seem to describe a behavior that just refreshes a page without processing any data, I think DaveBaldwin is right - the value of the HTML form action= attribute may be empty.  You may want to add error_reporting(E_ALL) to the scripts to be sure that you're not accidentally relying on any undefined variables.
0
 

Author Comment

by:rafique12
ID: 38747482
Okay, thankyou guys!

I have the form posting! but I now get a blank scree with this in the URL:

http://mysite/customer/account/loginPost/

Not sure what is causing it but I am trying to figure it out.

Thanks for your patients!
0
 
LVL 7

Expert Comment

by:whosbetterthanme
ID: 38747590
Thanks to Dave but he agreed with my initial assertion to post the source.
0
 

Author Comment

by:rafique12
ID: 38747594
Ok, can I change the award or is it too late?
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 38747634
The "blank screen" is often a symptom of an error when error reporting is turned off.  Make a search for "display errors" and "error_reporting" on the PHP.net web site and you'll find out how to raise the error messages so you can see what is happening.
0
 

Author Comment

by:rafique12
ID: 38747651
Thanks I got it to work. Magento uses: ini_set('display_errors', 1); which will show all errors but there weren't any but thanks for the advice.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question