Re: getting data from form...

From: Date: Thu, 18 Oct 2001 21:03:45 +0000
Subject: Re: getting data from form...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-71525@lists.php.net to get a copy of this message
TM> I have file ..... TM> index.php3.... a form in it ... TM> <input type=checkbox name=Steak value="15.25"> TM> <input type=checkbox name=XYZ value="10.25"> TM> <input type=checkbox name=CHIPs value="5.25"> TM> and how to make it that form.php3 will read all the data that was submitted TM> (i'm mean the name and the value) do you mean : reset($HTTP_POST_VARS); while (list ($name, $value) = each($HTTP_POST_VARS)) { proceed with them.... e.g. if ($name=="Steak") { echo "Variable name: ".$name." equals to ".$value; }; if ($name=="XYZ") { echo "Variable name : ".$name." and it's value is ".$value; }; ........... }; Put this code whereever you want to process your submited form Note that you haven't <input type="submit"> on your form, but in most cases it's necessaey to have it (exept some JavaScript was added).

« previous php.general (#71525) next »