【发布时间】:2018-02-27 07:42:10
【问题描述】:
我编写了一个 php 代码来保存输入的发布值,它发送到同一页面。事情就在这里,什么都不会发布。 代码如下:
<form name="form1" method="post" action="../page1.php" id="form1">
paid code:
<input id="pcode" type="text" />
<input type="submit" />
<?php
if(empty($_POST["pcode"])){
echo "<br/> This Field Cannot Be Empty";
}
else{
$num = $_POST["pcode"];
# To get a shorter version of the hash, just use substr
$hash = substr(md5($num), 0, 10);
echo $hash;
file_put_contents("code.txt", $hash ."\r\n", FILE_APPEND);
}
?>
</form>
它是 page1.php。我是不是做错了什么?
【问题讨论】:
-
保持空白...没有什么可写的