Newbie here!!! Need help with the "$_post"???
Posted: Tue May 20, 2003 9:05 pm
Hey guys, great site!!!
First let me say that I have read this post, http://www.devnetwork.net/forums/viewtopic.php?t=511
I will try and specify the jist of things... I am making a form that a person can type in information and then submit it and it will put it in a database. I am using
<form action="post_member.php" method="POST"> to do this.
My fields have the variable names 'nickname',' f_name',' l_name',' city', 'state', etc.... Here is an example:
printf('<input type="text" size="20" name="nickname" ><input type="text" size="20" name="F_Name" ><input type="text" size="20" name="L_Name" >
If I call the variables up using echo $_post['nickname'], it will display the variable for 'nickname'. But when I use the variable with the Insert command ie;
$sql = "INSERT INTO members (nickname) VALUES ($_POST['nickname'])";
I get Notice: Undefined variable: _post in D:\Web\Tim\gonzo\post_member.php on line 6
I know there is something stupid and easy I am missing, I just can't figure out what. Thanks for your help and again, sorry for the clutter.
Timmay!!!
First let me say that I have read this post, http://www.devnetwork.net/forums/viewtopic.php?t=511
I will try and specify the jist of things... I am making a form that a person can type in information and then submit it and it will put it in a database. I am using
<form action="post_member.php" method="POST"> to do this.
My fields have the variable names 'nickname',' f_name',' l_name',' city', 'state', etc.... Here is an example:
printf('<input type="text" size="20" name="nickname" ><input type="text" size="20" name="F_Name" ><input type="text" size="20" name="L_Name" >
If I call the variables up using echo $_post['nickname'], it will display the variable for 'nickname'. But when I use the variable with the Insert command ie;
$sql = "INSERT INTO members (nickname) VALUES ($_POST['nickname'])";
I get Notice: Undefined variable: _post in D:\Web\Tim\gonzo\post_member.php on line 6
I know there is something stupid and easy I am missing, I just can't figure out what. Thanks for your help and again, sorry for the clutter.
Timmay!!!