By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

Not getting values using $_POST - Please Reply Soon

P: 1

I have written following code and not getting back values in the same form ( i have used phpself)
$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$gender = $_POST["gender"];
$food = $_POST["food"];
$quote = $_POST["quote"];
$education = $_POST["education"];
$TofD = $_POST["TofD"];
<title>Personal INFO</title>
<form method="post" action="<?php echo $PHP_SELF;?>">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br />
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br />
Gender:<br />
Male:<input type="radio" value="Male" name="gender"><br />
Female:<input type="radio" value="Female" name="gender"><br />
Please choose type of residence:<br />
Steak:<input type="checkbox" value="Steak" name="food[]"><br />
Pizza:<input type="checkbox" value="Pizza" name="food[]"><br />
Chicken:<input type="checkbox" value="Chicken" name="food[]"><br />
<textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br />
Select a Level of Education:<br />
<select name="education">
<option value="Jr.High">Jr.High</option>
<option value="HighSchool">HighSchool</option>
<option value="College">College</option></select><br />
Select your favorite time of day:<br />
<select name="TofD" size="3">
<option value="Morning">Morning</option>
<option value="Day">Day</option>
<option value="Night">Night</option></select><br />
<input type="submit" value="submit" name="submit">


Read the Posting Guidelines before you post in this forum!

Especially the part about enclosing code within code or php tags!!

Feb 19 '07 #1
Share this Question
Share on Google+
2 Replies

P: 15
use this, it will solve your problem
<form method="post" action="<?php $PHP_SELF; ?>">
Feb 19 '07 #2

Expert 2.5K+
P: 4,258
Where did you get the idea that it doesn't work? There is nothing wrong in the passing of the values! They are all passed and assigned to the variables.

Of course you don't see anything because you don't do anything with the variables, like echoeing or alike.

Ronald :cool:
Feb 19 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.