DeanWhitehouse Posted October 28, 2008 Share Posted October 28, 2008 sorry no, but did the code work? Quote Link to comment https://forums.phpfreaks.com/topic/130281-solved-php-header-regirect/page/2/#findComment-676214 Share on other sites More sharing options...
Jagarm Posted October 28, 2008 Author Share Posted October 28, 2008 it didn't I appreciate for the code, I guess the logic is wrong, I'll have to find another way either to use header or to get the ob_start to work. no worries. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/130281-solved-php-header-regirect/page/2/#findComment-676220 Share on other sites More sharing options...
MadTechie Posted October 28, 2008 Share Posted October 28, 2008 header("Location: URL"); please note the URL is the absolute URI so myfile.php won't work correctly your need to use "http://{$_SERVER['HTTP_HOST']}/Blar.php" <?php /* Redirect to a different page in the current directory that was requested */ $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'mypage.php'; header("Location: http://$host$uri/$extra"); exit; ?> Quote Link to comment https://forums.phpfreaks.com/topic/130281-solved-php-header-regirect/page/2/#findComment-676244 Share on other sites More sharing options...
Jagarm Posted October 28, 2008 Author Share Posted October 28, 2008 header("Location: URL"); please note the URL is the absolute URI so myfile.php won't work correctly your need to use "http://{$_SERVER['HTTP_HOST']}/Blar.php" <?php /* Redirect to a different page in the current directory that was requested */ $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'mypage.php'; header("Location: http://$host$uri/$extra"); exit; ?> I did that that but still doesn't work, is not the url that is wrong Quote Link to comment https://forums.phpfreaks.com/topic/130281-solved-php-header-regirect/page/2/#findComment-676279 Share on other sites More sharing options...
Jagarm Posted October 28, 2008 Author Share Posted October 28, 2008 I'm going to use one of the MVC frameworks, maybe that will solve the problem. Thanks all for all your help. Quote Link to comment https://forums.phpfreaks.com/topic/130281-solved-php-header-regirect/page/2/#findComment-676282 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.