Solved

Mini login form not working

Posted on 2013-01-04
11
1,236 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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 108

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 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now