为了账号安全,请及时绑定邮箱和手机立即绑定

post保存在记事本里,请看看这段代码的问题出在哪里?

post保存在记事本里,请看看这段代码的问题出在哪里?

PHP
料青山看我应如是 2022-05-18 16:15:26
<?phpif(($_POST[name]=="") or ($_POST[bumen]=="") or ($_POST[zhiwu]=="") or ($_POST[gongsimingcheng]=="") or ($_POST[dianhua]=="") or ($_POST[chuanzhen]=="") or ($_POST[dizhi]=="") or ($_POST[youbian]=="") or ($_POST[E-mail]=="")){print("信息填写完整");}else{$fp=fopen("reg.txt","a+");$write="(姓名,部门,职务,公司名称,电话,传真,地址,邮编,E-mail) values ('$_POST[name]','$_POST[bumen]','$_POST[zhiwu]','$_POST[gongsimingcheng]','($_POST[dianhua]','$_POST[chuanzhen]','$_POST[dizhi]','$_POST[youbian]','$_POST[E-mail]')";fwrite($fp,$write);}?><form id="form1" name="form1" method="post" action="2.php"><p>姓名:<input type="text" name="name">部门:<input type="text" "name=bumen"> 职务:<input type="text" name="zhiwu"></p><p>公司名称:<input type="text" name="gongsimingcheng"></p><p>电话:<input type="text" name="dianhua"> 传真:<input type="text" name="chuanzhen"></p><p>地址:<input type="text" name="dizhi"></p><p>邮编:<input type="text" name="youbian"> E-mail:<input type="text" name="E-mail"> </p><td width="100%" align="center" colspan="2"><input type="submit" value="马上注册"> <input type="reset" value="全部重写"></td></form>
查看完整描述

1 回答

?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

<?php
if($_SERVER['REQUEST_METHOD']=='POST')
{
if(($_POST['name']=="") or ($_POST['bumen']=="") or ($_POST['zhiwu']=="") or ($_POST['gongsimingcheng']=="") or ($_POST['dianhua']=="") or ($_POST['chuanzhen']=="") or ($_POST['dizhi']=="") or ($_POST['youbian']=="") or ($_POST['E-mail']==""))
{
print("信息填写完整");
}
else
{
$fp=fopen("reg.txt","a+");
$write="(姓名,部门,职务,公司名称,电话,传真,地址,邮编,E-mail) values ";
$write.="('{$_POST['name']}','{$_POST['bumen']}','{$_POST['zhiwu']}','{$_POST['gongsimingcheng']}','{$_POST['dianhua']}','{$_POST['chuanzhen']}','{$_POST['dizhi']}','{$_POST['youbian']}','{$_POST['E-mail']}')";
fwrite($fp,$write);
fclose($fp);
}
}
?>

<form id="form1" name="form1" method="post">
<p>姓名:<input type="text" name="name">部门:
<input type="text" name="bumen"> 职务:<input type="text" name="zhiwu"></p>
<p>公司名称:<input type="text" name="gongsimingcheng"></p>
<p>电话:<input type="text" name="dianhua"> 传真:<input type="text" name="chuanzhen"></p>
<p>地址:<input type="text" name="dizhi"></p>
<p>邮编:<input type="text" name="youbian"> E-mail:<input type="text" name="E-mail"> </p>
<td width="100%" align="center" colspan="2"><input type="submit" value="马上注册"> <input type="reset" value="全部重写"></td>
</form>



查看完整回答
反对 回复 2022-05-23
  • 1 回答
  • 0 关注
  • 70 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信