send a value to another page when redirecting?
Posted: Wed May 05, 2010 2:04 pm
I want to have an error message on a page that comes up if the user entered something wrong (e.g., the wrong password).
The user starts at this page, call it index.php:
At action.php:
I want whatever happens in doSomething() on index.php to be affected by whether goodInput($POST["entrytext"]) in action.php was true or not. How can I have one page send a value to another page along with the header() redirect? There's no user entry happening on action.php, so I don't think I can use $POST to send a value back to index.php.
The user starts at this page, call it index.php:
Code: Select all
<html>
<body>
<form action="action.php" method="post">
<input type="text" name="entrytext">
<input type="submit">
<?php
doSomething();
?>
</body>
</html>Code: Select all
<?php
if goodInput($POST["entrytext"])
{
doThis();
}
else
{
doThat();
}
header("index.php");
?>