How do I get the name of a form on the next page?

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
Ford Prefect
Forum Newbie
Posts: 2
Joined: Sun Dec 01, 2002 5:19 am

How do I get the name of a form on the next page?

Post by Ford Prefect »

I would like to know which form has send the request. Is it possible to get the name of the form?

<FORM name="form1" ...>
...
</FORM>

<FORM name="form2" ...>
...
</FORM>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the form-element itself has no associated value but you may add a hidden field or assign values to the submit-buttons

Code: Select all

<form method=....>
	<input type="hidden" name="source" value="form1" />
	...
</form>

or

<form method=...>
	...
	<input type="submit" name="form" value="form1" />
</form>
Ford Prefect
Forum Newbie
Posts: 2
Joined: Sun Dec 01, 2002 5:19 am

Post by Ford Prefect »

Thanks, that works.
Post Reply