我有以下表格
<form action="/wp-content/themes/wallstreet/welcome.php" method="post" class="basic-grey">
<h1>Form
<span>Please fill all the texts in the fields.</span>
</h1>
<label>
<span>Your Nickname* :</span>
<input id="name" type="text" name="name" placeholder="It will appear " />
</label>
<label>
<span>Your Email* :</span>
<input id="email" type="email" name="email" placeholder="Valid Email Address" />
</label>
<label>
<span>Message* :</span>
<textarea id="messagebook" name="messagebook" placeholder="The text that will appear "></textarea>
</label>
<label>
<span>Code* :</span>
<input id="code" type="text" name="email" placeholder="The Code That we sent to your email" />
</label>
<label>
<span> </span>
<input type="submit" class="button" value="Send" />
</label>
如您所见,它适用于将表单提交到txt文件的PHP。
<?php
$var = $_POST['messagebook'];
file_put_contents("/var/www/wordpress/wp-content/themes/wallstreet/data.txt", $var . "\n", FILE_APPEND);
exit();
?>
好吧,我的目的是存储一个TXT文件,该文件将存储1000个唯一代码,例如
AD23A ASSD5 FJLQQ AS223 AS544 ...(等等)
txt格式与上面相同。
那么,我想用这段代码做点什么
<label>
<span> </span>
<input type="submit" class="button" value="Send" />
</label>
所以当字段中的代码与我的.txt文件中的代码一致时,提交按钮才有效。