这句错了,echo"<a href="$page">$page</a>";永远记得,双引号和单引号要成对出现,改成这样echo"<a href='$page'>$page</a>";或者echo"<a href=\"$page\">$page</a>";就对了

解决方案 »

  1.   

    楼上说得没错,但是从报错信息看,应该是它定义函数的命令写错了,应该是function,写成funcation,改一下
      

  2.   

    还有函数里面的return好像也写错了,这段东西很多错误,很多都没有中间加空格
      

  3.   

    <?
    function write_file ($filename, $contents){
    if ($fp=fopen ($filename,"w")) {
    fwrite($fp, stipslashes ($contents));
    fclose ($fp);
    return 1;
    }else{
    return 0;
    }
    };
    if($submitbutton=="完成"){
    $rs=write_file("$page","$test");
    echo "<a href=$page>$page</a>";
    }elseif($action=="page"){
    $content="$page";
    $fp=fopen($content,"r")or die ('could not open file .');
    $contents=fread($fp,filesize($content)) or die ('could not read from file .');
    $contents=htmlspecialchars($contents);
    fclose($fp);
    echo "<form action ='$PHP_SELF?page=$page' method= post>";
    echo "<textarea name =test rows=20 cols=70 wrap=soft>";
    echo $contents;
    echo "</testarea>";
    echo "<input type=submit name=submitbutton value= 完成>";
    echo "</form>";
    }else{
    echo "<form action='$PHP_SELF?action=page' method=post>";
    echo "<input type=text size=20 name=page>";
    echo "<input type=submit name=send value=选定>";
    echo "</form>";
    }
    ?>
      

  4.   

    呵呵,还要更正一下:
    <?
    function write_file ($filename, $contents){
    if ($fp=fopen ($filename,"w")) {
    fwrite($fp, stipslashes ($contents));
    fclose ($fp);
    return 1;
    }else{
    return 0;
    }
    };
    if($submitbutton=="完成"){
    $rs=write_file("$page","$test");
    echo "<a href=$page>$page</a>";
    }elseif($action=="page"){
    $content="$page";
    $fp=fopen($content,"r")or die ('could not open file .');
    $contents=fread($fp,filesize($content)) or die ('could not read from file .');
    $contents=htmlspecialchars($contents);
    fclose($fp);
    echo "<form action ='$PHP_SELF?page=$page' method= post>";
    echo "<textarea name =test rows=20 cols=70 wrap=soft>";
    echo $contents;
    echo "</textarea>";
    echo "<input type=submit name=submitbutton value= 完成>";
    echo "</form>";
    }else{
    echo "<form action='$PHP_SELF?action=page' method=post>";
    echo "<input type=text size=20 name=page>";
    echo "<input type=submit name=send value=选定>";
    echo "</form>";
    }
    ?>