我正在启动一个社交网络,它使用 Windows 记事本文件来保存此人的“提要”。但是,在我的帐户保存页面上,我的 PHP 似乎不起作用。它不会保存文件。对不起,如果我是“菜鸟”
这是我的代码:
<?php
$u = $_POST['user'];
$n = $_POST['name'];
$p = $_POST['password'];
$e = $_POST['email'];
$f = $_POST['email'] . ".txt";
$con=mysqli_connect("localhost","root","password","account");
mysqli_query($con,"INSERT INTO socialnet (name,user,password,file,email) VALUES ($n,$u,$p,$f,$e)");
$o = fopen('/' . $f,'c');
fwrite($o,"Hi. I just joined. Wait a few until I get my feed going");
fclose($o);
echo "<b>Your account has been saved. Now, please click the link at the top of the page to go back and log in.</b>";
?>
请不要严厉的回应。