submitting php variables from html POST method

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
serap
Forum Commoner
Posts: 31
Joined: Thu Jan 15, 2004 5:10 pm

submitting php variables from html POST method

Post 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
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post 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?
SomeDeveloper
Forum Newbie
Posts: 2
Joined: Mon Feb 23, 2004 7:08 pm

Post by SomeDeveloper »

if you want to pass an array variable then you might want to look into sessions.
evilMind
Forum Contributor
Posts: 145
Joined: Fri Sep 19, 2003 10:09 am
Location: Earth

Post by evilMind »

or [php_man]urlencode[/php_man] and [php_man]serialize[/php_man]
serap
Forum Commoner
Posts: 31
Joined: Thu Jan 15, 2004 5:10 pm

Post 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.
Post Reply