Mallinanga Posted March 30, 2003 Share Posted March 30, 2003 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 More sharing options...
0 Quboid Posted March 30, 2003 Share Posted March 30, 2003 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 More sharing options...
0 Clone5k Posted March 30, 2003 Share Posted March 30, 2003 Try this... <?php Header("location:http://www.yourserver.com/"); ?> Link to comment Share on other sites More sharing options...
0 m0fo Posted March 30, 2003 Share Posted March 30, 2003 <?php header("location: http://www.host.com/path/page.php"); ?> Link to comment Share on other sites More sharing options...
0 Clone5k Posted March 30, 2003 Share Posted March 30, 2003 I'm too slow :/ Link to comment Share on other sites More sharing options...
0 Mallinanga Posted March 30, 2003 Author Share Posted March 30, 2003 thank you all guyz!... but is that secure enough??? should i add some more variables to make this file more secure? Link to comment Share on other sites More sharing options...
0 [idkfa] Posted March 30, 2003 Share Posted March 30, 2003 why would you want to make it more "secure"? Link to comment Share on other sites More sharing options...
0 Mallinanga Posted March 30, 2003 Author Share Posted March 30, 2003 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 More sharing options...
0 spike232 Posted March 30, 2003 Share Posted March 30, 2003 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 More sharing options...
0 Mallinanga Posted March 30, 2003 Author Share Posted March 30, 2003 thanks a lot spike!!! your idea combined with the right .htaccess i think it is secure enough,isn't it? Link to comment Share on other sites More sharing options...
0 spike232 Posted March 30, 2003 Share Posted March 30, 2003 just using passworded .htaccess would be secure enought Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted March 30, 2003 Veteran Share Posted March 30, 2003 its not really secure atall... if you know where the "secure" page is then it means squat doesnt it! Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted March 30, 2003 Veteran Share Posted March 30, 2003 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 More sharing options...
Question
Mallinanga
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