kalyke Posted February 8, 2008 Share Posted February 8, 2008 This is my redirection code: 1 if(isset($_COOKIE['refurl'])){ 2 $CookieRefurl = $_COOKIE['refurl']; 3 $CookieJar = str_ireplace("www.MyHomepage.com", "", "$CookieRefurl"); 4 $Home = "Http://www.MyHomepage.com"; 5 header("Location: ".$Home.$CookieJar); 6 exit(); 7 }else{ 8 header("Location: http://www.fromhousetohome.com/preview"); 9 exit(); 10 } If I run it like this it redirects "Http://www.MyHomePage.comCookieRefurl" which is right except its missing the / So then I addes a slash on line 3 at the end of the url like this: ("www.MyHomepage.com/", ... It doesn't work at all So then I tried something like this ("www.MyHomepage.com" , "/" , No good then I tried ("www.MyHomepage.com", "//", .... And I get something like this: "Http://www.MyHomePage.com///CookieRefurl" To sum up, I can either have no slashes or too many or it doesn't work. Anybody have ideas how I can fix this. Quote Link to comment https://forums.phpfreaks.com/topic/90108-crazy-problem/ Share on other sites More sharing options...
kenrbnsn Posted February 8, 2008 Share Posted February 8, 2008 change <?php header("Location: ".$Home.$CookieJar); ?> to <?php header("Location: ".$Home. '/' . $CookieJar); ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/90108-crazy-problem/#findComment-462024 Share on other sites More sharing options...
thebadbad Posted February 8, 2008 Share Posted February 8, 2008 Or just append the slash in $Home on line 4. Quote Link to comment https://forums.phpfreaks.com/topic/90108-crazy-problem/#findComment-462025 Share on other sites More sharing options...
kalyke Posted February 8, 2008 Author Share Posted February 8, 2008 Tried both of those no luck. Quote Link to comment https://forums.phpfreaks.com/topic/90108-crazy-problem/#findComment-462033 Share on other sites More sharing options...
kalyke Posted February 8, 2008 Author Share Posted February 8, 2008 I have tried every combination of slashes and no slashes on every possible spot and none of them work. Is there another way maybe to do the same thing I'm trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/90108-crazy-problem/#findComment-462060 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.