I\'m trying to use the header() function to create a redirect. I would like to display an error message. Currently I\'m sending the message as a parameter through the URL,
Provided that you have local access to the page displaying the error, instead of redirecting you could include it in the page which caused the error and then programmatically display the error message.
if(something_went_wrong()) {
require_once('errors.php');
display_error('something really went wrong.');
}
The errors.php
file would then contain a definition for display_error($message)
, which displays the formatted message.