这句错了,echo"<a href="$page">$page</a>";永远记得,双引号和单引号要成对出现,改成这样echo"<a href='$page'>$page</a>";或者echo"<a href=\"$page\">$page</a>";就对了
解决方案 »
- 求php上传文件夹代码........
- file_get_contents的奇怪问题
- 关于php多国语言,gettext的问题!
- php 的结果展示???不知道了。。着急
- php发送email
- 如何用正则表达式提取所有的图片标签以及相应的src?
- 用PHP能否实现手机扣费??
- 急急急!!!!!!!!求一个好编辑器
- 我是想在文本框里显示PHP文件代码,而遇到的问题是汉字显示成了乱码。
- 这段中重复的implode函数该怎么解决呢
- 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>";
}
?>