[SOLVED] - FORM NAME not sent in $_POST

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
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[SOLVED] - FORM NAME not sent in $_POST

Post by anjanesh »

Why doesn't the FORM NAME not sent in $_POST ?

Code: Select all

if (isset ($_POST['Form1']))
{
echo 'This is never printed';
}
<FORM NAME=Form1 ACTION="" METHOD=POST>
//.....other input fields
</FORM>
Last edited by anjanesh on Wed Aug 18, 2004 9:40 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why should it? what value would get sent with it?
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

I'm not sure why it doesn't send for you on POST. But if you really need that kind of information, just use a <input type="hidden" ...> tag and put the information there.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

this.form.name will call the form name in javascript.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

It doesn't send it because that IS the form, not part of it. Like it's been suggested before, trying sending a hidden variable, or checking a variable that you know will have a value.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Alright. Thanks guys. I did use a hidden input. Just thought that might work too.
Anyway. Thanks
Post Reply