what is the best way to output error messages from one page to another?
i currently send the messages to display using header() with GET
Is there any good workarounds? or a standard way of doing it?
I've done it two different ways.
on the first page that produces the error I will do something along the lines of
[PHP]
if(//whatever produces your error)
{
print "Invalid Input";
include 'file.php';
}[/PHP]
OR
the other way would be to do something like this on the first page.
[PHP]// assign it to a variable like
$errormsg ="Invalid Input";
// add it to a hidden variable
print "<input type='hidden' value=$errormsg name='message'>
[/PHP]
then on the second page
[PHP]$errormsg = $_POST['message']; //to get the value from the posted page
print $errormsg; //to print the message[/PHP]