abdfahim Posted December 11, 2008 Share Posted December 11, 2008 I want to redirect the visitor to a certain page located at root directory using header function. I have two difficulties though 1) My server has a dynamic IP, as a result of that I cant use a direct path in my header location like http://123.123.123.123/mypge.php 2) I cant use a relative path in header location like ../mypage.php because the files where I put the header funtion located at different directories and subdirectories. I tried to use the following function in the server hosted at my PC /$_SERVER["HTTP_HOST"]/mypage.php but it returns http://localhost/localhost/mypage.php (watch two localhost) can anyone help? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 11, 2008 Share Posted December 11, 2008 So use an absolute path: /mypage.php Quote Link to comment Share on other sites More sharing options...
Twister1004 Posted December 11, 2008 Share Posted December 11, 2008 Or you could do this, ./mypage.php It works all the time =) (Not two dots, but one) Quote Link to comment Share on other sites More sharing options...
abdfahim Posted December 11, 2008 Author Share Posted December 11, 2008 thanx Mark Baker .. its funny that i used that method unsuccessfully with include and so I thought it wouldn't work with header !! I forgot the main diff betn include and header !! .... thnx again .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.