今天是第三天在PHP中文网学习!
代码:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>注册表单</title> </head> <body> <form action="" method="get"> <table border="0" cellspacing="0" cellpadding="6" bgcolor="99ffff"> <caption ><h2>注册表单</h2>(*为必填信息)</caption> <tr> <td><lable for="name">登录名</lable></td> <td><input styl="text" id="name" name="name" value="" placeholder="用户名必须是字母数字,不能以数字开头" size="50">* </td></tr> <tr> <td><lable for="pasword">密码</td> <td><input styl="password" id="pasword" name="password" value="" placeholder="密码必须是6~16位数字字母" size="50">* </lable></td></tr> <tr> <td>确认密码</td> <td><input styl="password" name="password" value="" placeholder="必须和密码相同" size="50">* </td></tr> <tr> <td>邮箱地址</td> <td><input styl="emall" name="emall" value="" placeholder="123456@163.com" size="50">* </td></tr> <tr> <td>确认邮箱地址</td> <td><input styl="emall" name="emall" value="" placeholder="123456@163.com" size="50">* </td></tr> <tr> <td>性别</td> <td><input type="radio" name="sex" value="male">男 <input type="radio" name="sex" value="woman">女 <input type="radio" name="sex" value="secret" checked>保密</td></tr> <tr> <td>头像</td> <td> <img src="../images/319.jpg" height="40"><input type="file" name="photo" accept="image/*"> </td></tr> <tr> <td>兴趣爱好</td> <td><input type="checkbox" name="hobby[]" value="travel">旅行 <input type="checkbox" name="hobby[]" value="game">游戏 <input type="checkbox" name="hobby[]" value="read">阅读 <input type="checkbox" name="hobby[]" value="run">跑步 <input type="checkbox" name="hobby[]" value="sport">运动</td> <tr> <td>城市</td> <td><select name="city" id="city"> <option value="" selected="">北京</option> <option value="">上海</option> <option value="">广州</option> <option value="">深圳</option> <option value="">南京</option></select></td></tr> <tr> <td>个人简介</td> <td><textarea cols="40 " rows="3"name="comment" placeholder="特长,工作经历,个人荣誉" value=""></textarea></td></tr> <tr> <td colspan="2"><input type="button" name="button" value="提交""></button> <input type="reset" name="reset" value="重置"></reset> </td> </tr> </body> </html>
手写代码: