当前位置:Gxlcms > PHP教程 > php在线文本编辑器_PHP

php在线文本编辑器_PHP

时间:2021-07-01 10:21:17 帮助过:6人阅读

作者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 "";

}

else

{ echo "";

}

?&g

人气教程排行