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, however this makes it look quite ugly.
Is there a way to pass this value as a post variable instead?
Any advice appreciated.
Thanks.
Dan, You could start and store a session in PHP then save the message as a session variable. This saves you from having to transfer the message in an HTTP request.
Manipulating Sessions
Now, within
bar.phpyou can access those POST variables by re-initiating the session.To read more about sessions, check out: http://php.net/manual/en/function.session-start.php