我正在尝试使用 4 个输入从我的 html 表单中添加一些文本。我可能一直盯着自己看,但我不知道它在哪里失败。
Ihave tried with "a" instead of doing the "r" and then "w" option.
$fuldenavn = $_POST["navn"];
$voksneantal = $_POST["voksne"];
$bornantal = $_POST["born"];
$kontaktinfo = $_POST["contacts"];
$content = $fuldenavn. PHP_EOL .$voksneantal. PHP_EOL .$bornantal. PHP_EOL .$kontaktinfo.;
$file = fopen("tilmeldinger.txt", "r");
$old_content = fread($file, filesize('tilmeldinger.txt'));
fclose($file);
$file = fopen('tilmeldinger.txt', 'w');
fwrite($file, $content."\n".$old_content);
fclose($file);
echo "Din tilmelding er modtaget. Tak! :)";
我有两种不同的结果,空白页或错误 500。
html表单:
<form method="post" action="tilmeld_noc.php">
Fulde navn: <input type="text" name="navn"></tab>
Antal Voksne: <input type="text" name="voksne" value="0">
Antal u. 12: <input type="text" name="born" value="0">
E-mail el. tlf.: <input type="text" name="contacts" value="0"><br>
<input type="submit" id='tilmeldbutton' value="Send Tilmelding" />
</form>
回首忆惘然
郎朗坤
一只萌萌小番薯
随时随地看视频慕课网APP