I have a form called insert_comment.php it contains this function:
function died($error) { // if something is incorect, send to given url with error msg
header("Location: http://mydomain.com/post/error.php?error=" . urlencode($error));
die();
}
Further down the code, the $error_message is sent to function die, then function die redirects the user to mydomain.com/post/error.php where I get the error message from the URL:
$error = $_GET["error"];
echo 'some text '. $error .' sometext';
Is there any way to do the exact same thing using a POST redirect? I don't like displaying the entire error message in the URL, it looks very ugly.