如何在这个演示表单上使用php中的服务器端验证?

时间:2015-05-11 05:30:57

标签: validation server

<!--------- THIS IS A DEMO FORM I WANT TO VALIDATE THIS ON SERVER SIDE -->


 <form name= "registration" id= "registration" method= "post" action= "">
 <table width= "400" border= "0" align="center" cellpadding= "4" cellspacing= "1">
    <tr>
    <td>Employee Name:</td>
    <td><input name= "emp_name" type= "text" id="emp_name" value=""></td>
    </tr>
    <tr>
    <td>Contact No.: </td>
    <td><input name= "emp_number" type= "text" id= "emp_number" value=""></td>
    </tr>
    <tr>
    <td> Personal Email: </td>
    <td><input name= "emp_email" type= "text" id= "emp_email" value=""></td>
    </tr>
    <tr>
    <td> </td>
    <td><input type= "submit" name= "Submit" value= "Submit" ></td>
    </tr>
    </table>
    </form>

<!-- end snippet -->

1 个答案:

答案 0 :(得分:0)

第一步是确保表单将脚本重定向到PHP文件,或者这个HTML在PHP文件中。

目前尚不清楚验证的含义,但如果您想验证空字段,可以试试这个:

{{1}}