简单php在线编辑保存php文件实现代码
简单php教程在线编辑保存php文件实现代码
*/
if($_get['login']=='fuying'){
header("content-type: text/html; charset=gb2312");
if(get_magic_quotes_gpc()) foreach($_post as $k=>$v) $_post[$k] = strips教程lashes($v);
?>
<form method="post">
save to: <input type="text" name="file" size="60" value="<? echo str_replace('','/',__file__) ?>">
<br><br>
<textarea name="text" cols="70" rows="18" ></textarea>
<br><br>
<input type="submit" name="submit" value="save">
<form>
<?php
if(isset($_post['file']))
{
$fp = @fopen($_post['file'],'wb');
echo @fwrite($fp,$_post['text']) ? 'succed!' : 'faled!';
@fclose($fp);
}
}
补充:Php教程,Php高级应用