Load PHP posted vars into array
Hi,
------------
EDIT
Sorry, I just read what I typed in the heading... tried to edit it but I cant...
Load HTML posted variables into PHP variables ... makes a bit more sense.
------------
I am trying to write a function that will load vars posted from a web page into PHP vars with the SAME name.
Like this:
<form>
<input name="xxx" type="text" value="111">
<input name="yyy" type="text" value="222">
<input name="zzz" type="text" value="333">
</form>
When this is posted to my php, I want to call a function
LoadVars();
This will create the vars $xxx, $yyy and $zzz and set them to the correct values.
The code below gives a list of all html vars and values, but I am struggling to do what I mentioned above.
<?php
foreach($_POST as $key=>$val) {
echo '$_POST['.$key."] = $val<br>n";
}
?>
Any ideas???
Thanks.
Last edited by DMeerholz; 07-03-2007 at 08:21 AM.
|