Forum Moderators: coopster

Message Too Old, No Replies

Header Not working

but meta refresh does

         

ukgimp

10:20 am on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In a script that looks for posted variables and then errors and if no errors does and insert. I have a problem with setting the page to forward.

If I use the header command:
header("Location: $u");

It does not work. However if I use meta refresh it does work:

print "<META HTTP-EQUIV=\"refresh\"content=\"2;URL=http://localhost$u\">";

The header command works properly on many pages.

I even tried an

exit;

after the header commant, but that does not work either.

Can anyone she any light on this at all please.

Cheers

Birdman

11:48 am on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like the header redirect is inside a conditional and is not getting run. Have you tried printing something to verify that the script has gotten to the header comand?

print "header is next!";
header("Location: $u");

ukgimp

12:01 pm on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BM

You are right, it has taken me a couple of hours. I stripped it right down to get the nested conditionals sorted then builtit back up, and 1 minute ago, 12:59 I sorted it. :). Was just about to post and saw your reply.

I need to comment my code more.