<?php
if (true) {
    header(Location: index.htm);
    die;
} else {
    header(Location: error.htm);
    die;
}
?>

解决方案 »

  1.   

    方法一:header("Location: index.php"); 
    方法二:echo "<script>window.location =\"$PHP_SELF\";</script>"; 
    方法三:echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php\">";
      

  2.   

    header("Location: index.php"); 
    echo "<script>window.location =\"$PHP_SELF\";</script>"; 
    echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php\">";