• 0

php redirect...


Question

hi...

i would like to make a php file that would redirect me to another url automatically...

is there a way to do this without the need to write a whole html page including javascript to redirect me???

if yes does anybody know how?

thanks in advance!

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Just put in the PHP code:

header("Location: www.site.com/page");

Replace that URL with whatever you want. You can add variables if you wish. That might have to be send before any HTML or such like is sent, I'm not sure.

Link to comment
Share on other sites

  • 0

well this is a file just for me...

to view my web statistics...the normal url is way to long so i wanted to created a php file to redirekt me there...but i need to login...

and of course a cookie is being created every time...so if you time once again the address of the file you go there without login! :(

that's what i mean by securing it

Link to comment
Share on other sites

  • 0

u could add a simple login, like:

<?php
if($pass == "password")
{

header("location: http://www.host.com/path/page.php");

}
else
{
echo "Bad password";
}
?>

then when u call the page u pass the password as a parameter so:

page.php?pass=password

Link to comment
Share on other sites

  • 0
its not really secure atall... if you know where the "secure" page is then it means squat doesnt it!

But if you have a password on it, than it is...

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.