Nice clean helpful post there intrinzic!
and now for mine which probally wont be...
ok you could make the function to do that redirect if its a little easier.
PHP Code:
function redirect($pg, $error_msg) { header("Location: $pg?error=$error_msg"); }
with the above if u have that included in the script you (should) be able to use the redirect() how you were
and the first part will be the page, and the second the error message.
you could also use:
PHP Code:
function redirect($pg, $error_msg) { if(!isset($error_msg) { header("Location: $pg"); } else { header("Location: $pg?error=$error_msg"); } }
this second one is a bit more, the first ones a little more generic
This one, checks if you have enterd a second bit, so if u put
PHP Code:
redirect(index.php);
it should look at it see it isnt set, and do a striaght redirect to that page using header("Location: $pg");
if it looks at it and see you have enterd soemthing else like:
PHP Code:
redirect(index.php, error! something when wrong);
it should redirect to index.php?error=error! something when wrong
I have not tested this.
But i hope it helps,
Dan
Talkupation Apprieciated 
__________________
Personal UK Webhosting Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
Last edited by dansgalaxy : 08-18-2007 at 06:58 AM.
|