Redirect page<

liunx

Guest
What is the PHP code to redirect you to another page? Like when you post a message on this board, you get a page that says YOU WILL BE DIRECTED TO YOUR POST... What is the code to do that?

Thanks.that code is not php but just a meta tag

<META HTTP-EQUIV="Refresh" Content="5;URL=your site you want to goto.com">

in php it is

header("locatin: page.php");Originally posted by scoutt
that code is not php but just a meta tag

<META HTTP-EQUIV="Refresh" Content="5;URL=your site you want to goto.com">

in php it is

header("locatin: page.php");

small typo there bud ;)

header("Location: page.php");hehe thanks, dang keyboard, types what it thinks I want. wonder if this keyboard is made by M$ :Phehe..I love my keyboard(refurbuished one I bought at the flea market...my like 4th new one this year :rolleyes: ) hehe...it happens,we all have our hardware go 'm$' on us at times ;)Hey, thanks guys, you've been a real help! ;)

P.S. I never got an e-mail notification :confused:>> my like 4th new one this year <<

On one computer here, I am still using an original IBM AT keyboard that is, like, 15 years old. Apart from removing all the keycaps twice a year and washing them in warm soapy water this keyboard is as good as new after typing several million (umm, maybe tens of millions by now) words on it.It is good practice to add exit() after using the header function for redirection, like so:

header("Location: destination.php");
exit;

It depends on where you use it of course, but if you for instance use it to redirect an unregistered user to a log-in page, when the user is trying to access a restricted page, it wouldnt be hard for a cracker to make his browser disregard the header you send, and your script would still show the restricted page.Hello:

I am using

session_start();
$HTTP_SESSION_VARS["Authenticated"]="Start";// Redirect user to update page
echo "<script>document.location.href='http://www.htmlforums.com/archive/index.php/update.php';</script>";
exit;

to redirect my page

also tried:

session_start();
$HTTP_SESSION_VARS["Authenticated"]="Start";// Redirect user to update page
header("Location: update.php")
exit;


But when chekking for $HTTP_SESSION_VARS["Authenticated"] at the redirected page, the session variable do not exist.

Any want subjest me something?

Best regards

Rodolfostart your own thread. your problem doesn't have anything to do with redirects.Sorry, my error was I omitted the:

session_start();

In the next ages. This is needed for session variables restoring,

Thanks,

Rodolfo
 
Back
Top