今天是在php中文网学习的第三天
代码:
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <titl></title> </head> <body> <form action="" method="post"> <table border="1" cellspacing="1" cellpadding="3" bgcolor="#FFFAF4" align="center" width="500"> <h2 align="center">购买北京奔驰</h2> <tr align="center"> <td align="left"><label for="name">姓名:</label></td> <td align="left"> <input id="name" type="name" name="name" placeholder="请输入您的姓名" size="50"> </td> </tr> <tr align="center"> <td align="left"><label for="number">手机号码:</label></td> <td align="left"> <input id="number" type="number" name="number" placeholder="请输入11位有效号码" size="50"> </td> </tr> <tr align="center"> <td align="left"><label for="sex">性别:</label></td> <td align="left"> <input type="radio" name="sex" value="nan">男 <input type="radio" name="sex" value="nv">女 </td> </tr> <tr align="center"> <td align="left"><label for="card">身份证号码:</label></td> <td align="left"><input ID="card" type="number" name="card" placeholder="请输入您的身份证号码" size="50"> </td> </tr> <tr align="center"> <td align="left"><label for="color">选择您的汽车颜色:</label></td> <td align="left"> <input type="radio" name="color" value="white">白色 <input type="radio" name="color" value="black">黑色 <input type="radio" name="color" value="yellow">黄色 <input type="radio" name="color" value="red">红色 <input type="radio" name="color" value="green">绿色 <input type="radio" name="color" value="bule">蓝色 </td> </tr> <tr align="center"> <td align="left">付款方式:</td> <td align="center"> <select name="payment"> <option>现金</option> <option>分期</option> <option>微信</option> <option>刷卡</option> <option>支付宝</option> </select> </td> </tr> <tr align="center"> <td align="left">分期几年:</td> <td align="center"> <select name="year"> <option>一年</option> <option>两年</option> <option>三年</option> <option>不分期</option> </select> </td> </tr> <tr align="center"> <td align="letf">加装:</td> <td align="left"> <input type="checkbox" name="hobby{}" value="1.8T">豪华内饰 <input type="checkbox" name="hobby{}" value="2.5T">18寸轮胎 <input type="checkbox" name="hobby{}" value="2.5T">运动座椅 <input type="checkbox" name="hobby{}" value="4.0T">真皮座椅 </td> </tr> <tr align="center"> <td align="left"><label for="photo">身份证复印件:</label></td> <td align="left"> <input id="photo" type="file" id="photo" name="photo" accept="images/*"> </td> </tr> <tr align="center"> <td align="left"><label for="comment">留言:</label></td> <td align="left"> <textarea rows="4" cols="50" id="comment" name="comment" placeholder="需要加装请留言!!!"></textarea></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" name="submit" value="提交"> <input type="reset" name="reset" value="重置"> </td> </tr> </table> </form> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
手写代码: