Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mini login form not working

Posted on 2013-01-04
11
Medium Priority
?
1,312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 84

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 1000 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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 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 111

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

721 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