Posted by ninjadev on 12/08/05 09:19
fun with forms... iterate_form() not only spits out the values, but
will give you the $var = $_POST['var'] code for the receiving page...
have fun
function iterate_form()
{
echo "<b>Values:</b><br>";
foreach($_POST as $key => $value)
{
echo $key . " = " . $value . "<br>";
}
echo "<br><br><b>Happy Coding:</b><br>";
foreach($_POST as $key => $value)
{
echo "$". $key . " = \$_POST['". $key . "'];<br>";
}
build_back_form();
exit;
}
function build_back_form()
{
echo "<form name='error' method='post' action='".
$_SERVER['HTTP_REFERER'] ."'>\n";
foreach ($_POST as $key => $value)
{
echo "<input type='hidden' name='" . $key . "' value='" .
$value . "'>\n";
}
echo "<input type='submit' name='submit' value='Go
Back'></form>\n";
}
Navigation:
[Reply to this message]
|