Posted by David Haynes on 05/21/06 16:11
Alex Murphy wrote:
> But... how to post a predefined variable?
>
The first step is to get php to send the predefined value to the web
browser. This may be done using SESSIONs.
session_start();
$_SESSION['predefined'] = $predefined;
session_write_close();
header('Location: first_page.php');
Then, in first_page.php, you get the predefined value back and place it
into a POST value.
session_start();
<form action="second_page.php" method="POST">
<input type="hidden" name="predefined" value="<?php echo
$_SESSION['predefined'];?>">
</form>
Now, the value of 'predefined' is available to second_page.php as a
$_POST value.
$predefined = $_POST['predefined'];
Does this help?
-david-
[Back to original message]
|