Jump to content

Having the same 2 forms on the one page


cliftonbazaar

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.