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

<?php
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 ('$_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>

料青山看我应如是
浏览 71回答 1
1回答

慕田峪7331174

<?phpif($_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>
打开App,查看更多内容
随时随地看视频慕课网APP