问题描述
我想编写一个网络应用程序,可以在服务器上编辑一个简单的文本文件。用户将字符串写入表单,然后按输入(按钮)。该文件应该已更改,但不起作用。
我的HTML;
<form name="form" action="" method="post">`
<input type="text" id="msg" name="msg" placeholder="Enter message...">
</form>
<input type="submit" name="send" value="Send">
我的PHP:
<?PHP
if(isset($_POST['send'])){
$chatfile = fopen("chat.txt","w");
$message = $_POST['msg'];
fwrite($chatfile,$message);
fclose($chatfile);
}
?>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)