Greg Mascherino wrote:
I need to be able to pass from fields to PHP from severel
different forms on a page.
Only if they have the same name.
[...]
I am open to any suggestions and will try using cookies,
javascript arrays, hidden form fields, or whatever it takes.
Maybe (I don't know JavaScript) you can pull all values from all forms
when you click a "submit" and put them in hidden fields of another form
and POST _that_ form to PHP.
The only
drawback is I have to use multiple forms so combining forms is not an
option.
try this:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo '<pre>'; print_r($_POST); echo '</pre>';
}
echo <<<HTML
Form1:
<form name="form1" action="" method="post">
<input type="hidden" name="both" value="both"/>
<input type="hidden" name="oneonly" value="oneonly"/>
<input type="submit"/>
</form>
<br/><hr/><br/>
Form2:
<form name="form2" action="" method="post">
<input type="hidden" name="both" value="both"/>
<input type="hidden" name="twoonly" value="twoonly"/>
<input type="submit"/>
</form>
HTML;
?>
When you submit the first form you'll be able to access $_POST['both']
and $_POST['oneonly'], but not $_POST['twoonly'].
Likewise for submitting the second form -- no $_POST['oneonly'].
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--