这句错了,echo"<a href="$page">$page</a>";永远记得,双引号和单引号要成对出现,改成这样echo"<a href='$page'>$page</a>";或者echo"<a href=\"$page\">$page</a>";就对了
解决方案 »
- php读取mysql中文汉字出现乱码
- incluede显示代码了 不显示视图。。
- 请问HTML_QuickForm + Smarty创建的注册界面的问题
- 唉,又犯晕了,帮帮忙
- 关于匹配空格的问题
- 循环的问题
- 大家好,我们想做一个网站,价格4000元,有谁愿意的请联系我!!!
- 为什么下次打开浏览器session_start()后总是覆盖原cookie?
- PHP $_SERVER['DOCUMENT_ROOT'] 问题
- PHP如果实现自定义公式
- PHP安装文件的两种形式(PHP 4.3.0 installer、PHP 4.3.0 zip package)哪种更好?应该在什么情况下选择什么?不明白PHP 4.3.0 installer
- 都说php用word很简单!!我怎么从来没成功过!!!!??
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>";
}
?>
<?
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>";
}
?>