Solved

Mini login form not working

Posted on 2013-01-04
11
1,283 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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

752 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