본문 바로가기
정보기술/일반

[Web] How to redirect after headers are sent - PHP Forums - Dev Shed Forums

by fermi 2003. 8. 19.
How to redirect after headers are sent - PHP Forums - Dev Shed Forums

http://forums.devshed.com/t46591/s.html

[1]

$goto = '/file.php';
echo <<<END
<script language="javascript"><!--
window.location='$goto';
//--></script>
END;


[2]

echo "<META http-equiv='refresh' content='0;URL=yourpage.html'>";


[3]

ob_start();
// print whatever you want - the user won't see it
// since you're redirection later...
header("Location: /path/page.php");
exit;


[4]

echo "<script language='javascript'>location.href='cms_main.php?msg=Your changes have been added.</script>";


[5]

echo " <script language='javascript'>
location.replace('your_page.php?any_variables&x=whatever');
</script>";