DeanWhitehouse Posted October 28, 2008 Share Posted October 28, 2008 sorry no, but did the code work? 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 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; ?> 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 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. 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
Archived
This topic is now archived and is closed to further replies.