Page 1 of 1
[SOLVED] Losing Variable from Form
Posted: Mon Feb 28, 2005 3:12 am
by lazersam
Hi
I am passing a variable from a form to a php handler but when I use
Code: Select all
$first_name = $_POSTї'first_name'];
the variable is lost! If I leave out the $_POST code I can retain the variable. Does anyone know why this is so? I have other form handlers that are written the same but work OK.
Larry.
Posted: Mon Feb 28, 2005 3:19 am
by CoderGoblin
What happens if you do a var_dump($_POST); ?
Does the first_name get displayed ? If not (the array is empty) please check the form is sending POST not GET.
Please give us more specific information (such as the form definition) in order that we can try to help you. The more "consise" information you give the easier it is for us to help you.
At a guess I would say it works leaving the $_POST because you have register_globals ON. Loads of posts on this so I will just say this is a bad idea.
Regards
Posted: Mon Feb 28, 2005 7:56 am
by lazersam
Thanks - you are right! I forget to method="POST" in form
Thanks for your help.
Larry