php在线文本编辑器_PHP
作者:leon0324
<?
function write_file($filename,$contents)
{ if ($fp=fopen($filename,"w"))
{
fwrite($fp,stripslashes($contents));
fclose($fp);
return 1 ;
}
else {return 0; }
};
if ($submitbutton=="完成")
{ $rs=write_file("$page","$test");
echo "$page">$page
";
}
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 ";
echo $contents;
echo "";
echo "<input type="submit" name="submitbutton" value="完成">";
echo "";
}
else
{ echo "<form action="$PHP_SELF?action=page" method="post">";
echo "";
echo "<input type="submit" name="send" value="選定">";
echo "";
}
?&g
總結(jié)
以上是生活随笔為你收集整理的php在线文本编辑器_PHP的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 同盟与对抗:谈《少女杜拉的故事》中的治疗
- 下一篇: javascript - 怎样实现浏览器