problem in php forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saqib389
Forum Commoner
Posts: 44
Joined: Wed Nov 30, 2005 2:13 am

problem in php forms

Post 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 >?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post 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' />
Post Reply