Page 1 of 1

submitting php variables from html POST method

Posted: Mon Feb 23, 2004 5:08 pm
by serap
I would like to ask if it is possible to get the a php variable (in this case $dummy) to be submitted from html to some other php code? (value=????) with/without echoing html??

...
<?php
$dummy="checkthisstuff";
?>
... som html ...
...
<form name="Submit1" method="post" action="http://xxx/update.php">
<input type=hidden name=dummy value=???????>
<input name="Submit1" type="submit" class="submitbutton" value="Update"></td>
...

And how would that be possible if I were to submit an (probably mutidimensional) array instead of $dummy?
I need to process/handle the array ingredients and post them back on the site of origin.

Serap

Posted: Mon Feb 23, 2004 6:12 pm
by tsg

Code: Select all

<form name="Submit1" method="post" action="http://xxx/update.php"> 
<input type=hidden name=dummy value="<? print "$dummy"; ?>"> 
<input name="Submit1" type="submit" class="submitbutton" value="Update"></td>
And what is an example of what you mean by the array? Checkboxes or something?

Posted: Mon Feb 23, 2004 7:30 pm
by SomeDeveloper
if you want to pass an array variable then you might want to look into sessions.

Posted: Mon Feb 23, 2004 11:01 pm
by evilMind
or [php_man]urlencode[/php_man] and [php_man]serialize[/php_man]

Posted: Tue Feb 24, 2004 2:06 am
by serap
Thanks for the replies,

In first place I cant even get the $dummy variable to be passed to the 'update.php'. Thats my main concern - getting the variable $dummy from the php to be submitted.