cliftonbazaar Posted November 25, 2010 Share Posted November 25, 2010 I have a log in area at the top (and bottom) of my home page - and neither of them work, but if I delete either of them then the other works. My code is <FORM ACTION="check_login.php" METHOD="post"> <P ALIGN="center"><b>User name :</b> <INPUT TYPE="Text" NAME="UserName" SIZE="25"><b>Password :</b> <INPUT TYPE="Password" NAME="Password" SIZE="25"> <INPUT TYPE="Submit" VALUE="Login"></FORM> Note that the code at the top and bottom were cut and pasted so they are EXACTLY the same. I tried to delete "</FORM>" from the top one and "<FORM ACTION="check_login.php" METHOD="post">" from the bottom one but they still don't work. Is there a way to get these both working? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 25, 2010 Share Posted November 25, 2010 Exactly how do they not work? What is in check_login.php? Quote Link to comment Share on other sites More sharing options...
cliftonbazaar Posted November 25, 2010 Author Share Posted November 25, 2010 Exactly how do they not work? What is in check_login.php? Sorry, should have explained this better. In check_login.php if username or password aren't valid then you goto an error page. If you put the correct username and password into the main page while the code (that I put in my original post) is on the page TWICE then you end up at the error page; if the code is on the page ONCE then everything is successful. Hope this explains it better. Quote Link to comment Share on other sites More sharing options...
radar Posted November 26, 2010 Share Posted November 26, 2010 Your form should always have a name. I've created a page (for giggles) on my local server that all it does is log people in, it has 13 login forms and all 13 work.... Try adding a name like frmLoginTop and frmLoginBottom and see what happens then... your submit button should also have a name... ie: <input type="submit" name="button" id="button" value="Submit">. I have sometimes run into weird issues when i try to use caps for everything in HTML like mysql SELECT * FROM blah WHERE d = BLEH or the like. So turn down the caps and see where that takes you from there. also code on the html other than a single form would be helpful. Quote Link to comment Share on other sites More sharing options...
cliftonbazaar Posted November 26, 2010 Author Share Posted November 26, 2010 SOLVED - Giving each form its own name did the trick. Thanks to those that answered Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.