<?
if(isset($_POST['date'])){ 
header("Location: {$_POST['date']}");
}
else
{echo "helloworld";}
?>

解决方案 »

  1.   

    不行哦,它提示说:Warning: Cannot add header information - headers already sent by (output started at I:\myWeb\diary\direct.php:9) in I:\myWeb\diary\direct.php on line 11
      

  2.   

    把 <? 前的所有内容去掉,即以下内容:
    ------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    -------------------------------
      

  3.   

    把 <? 前的所有内容去掉,即以下内容:
    ------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    -------------------------------