//增加必填字段判断 if($required!=''){ if(preg_match('/,/', $required)) { $requireds = explode(',',$required); foreach($requireds as $field){ if($$field==''){ showMsg('带*号的为必填内容,请正确填写', '-1'); exit(); } } }else{ if($required==''){ showMsg('带*号的为必填内容,请正确填写', '-1'); exit(); } } } //end |
<form action="/plus/diy.php" enctype="multipart/form-data" method="post"> <input type="hidden" name="required" value="name,qq" /> <input type="hidden" name="action" value="post" /> <input type="hidden" name="diyid" value="1" /> <input type="hidden" name="do" value="2" /> <table style="width:97%;" cellpadding="0" cellspacing="1"> <tr> <td align="right" valign="top">姓名:</td> <td><input type='text' name='name' id='name' style='width:250px' class='intxt' value='' /> </td> </tr> <tr> <td align="right" valign="top">性别:</td> <td><select name='sex' style='width:50px'><option value='男'>男</option> <option value='女'>女</option> </select> </td> </tr> <tr> <td align="right" valign="top">电话:</td> <td><input type='text' name='tell' id='tell' style='width:250px' class='intxt' value='' /> </td> </tr> <tr> <td align="right" valign="top">地址:</td> <td><input type='text' name='add' id='add' style='width:250px' class='intxt' value='' /> </td> </tr> <tr> <td align="right" valign="top">备注内容:</td> <td><input type='text' name='con' id='con' style='width:250px; height:100px' class='intxt' value='' /> </td> </tr> <input type="hidden" name="dede_fields" value="name2,text;sex2,select;tell2,text;add,text;con2,text" /> <input type="hidden" name="dede_fieldshash" value="78764e448024ba3607705cbf961ebf3f" /></table> <div align='center' style='height:30px;padding-top:10px; padding-left:130px'> <input type="submit" name="submit" value="提 交" class='coolbg' /> <input type="reset" name="reset" value="重 置" class='coolbg' /> </div> </form> |
欢迎光临 360°网站管家_运维学院_提供最新最全的服务器运维视频教程与网站维护视频教程 (http://bbs.360wzgj.com/) | Powered by Discuz! X3.2 |