Invalid URI msg

I’ve been having a horriable time trying to get a page to redirect using a header()

my code:

header(“Location: /”.$_COOKIE[‘refurl’]);

when it executes it gives me and “Invalid URI” error and the address bar of the pages looks like this:

When I take out the / at “Location : /” it does this endlessly: etc.

I’ve used all my brain power on this problem, and I just don’t know what to do.
Any help is greatly appreciated.

Looks like you’re forgetting about the http:// part:

header("Location: http://".$_COOKIE['refurl']);

Btw, don’t trust user input (cookies) like that. Test its value to make sure it’s valid.

Sponsor our Newsletter | Privacy Policy | Terms of Service