Page 1 of 1

problem in php forms

Posted: Sun Jan 15, 2006 5:17 am
by saqib389
i have include search metho in my left menu like this

Code: Select all

<form name=form1 method=post action=search.php>
<input type=text name=q>
<input type=submit value="search now" >

</form>
and in the same page i have login form

like this

Code: Select all

<form name=form2 method=post action=login2.php>
<input type=text name=username>
<input type=text name=password>
<input type=submit value="login now" >
</form>
so when i click on login form . then there will b open SEARCH.PHP page.. what is this happening
can any one tell me what mistake i m doing >?

Posted: Sun Jan 15, 2006 7:21 am
by raghavan20
I cannot understand what you are saying.
From your code, this should happen else something is wrong.
I assume that these two forms are on the same page
When you search for something using search form, it should take you to search.php page
When you submit the login form then it should take you to login2.php page.

Do make sure you put all the values of properties of a control within double quotes. It improves consistency and avoids unexpected errors.

Code: Select all

Jus like this....
<input type = "button" name = 'redirectButton' value = 'Take me to home page' />