Solved

Mini login form not working

Posted on 2013-01-04
11
1,216 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 82

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 82

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

746 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

10 Experts available now in Live!

Get 1:1 Help Now