PHP développe une page d'enregistrement des utilisateurs d'un système simple de prêt de livres
Cette section crée d'abord une page frontale enregistrée
Affichez les champs que nous avons créés dans la table de base de données sur la page HTML.
Utilise les formulaires <form> et les tableaux <table>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <form name="form1" method="post" action="" enctype='multipart/form-data' onSubmit="return checkreg()" > <table width="782" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <th colspan="2" bgcolor="#FFFFFF"><font size="5">用 戶 注 冊 界 面</font></th> </tr> <tr> <td width="364" align="right" bgcolor="#FFFFFF">姓 名:</td> <td width="403" bgcolor="#FFFFFF"> <input type="text" name="name"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">密 碼:</td> <td bgcolor="#FFFFFF"> <input type="password" name="password"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">確認(rèn)密碼:</td> <td bgcolor="#FFFFFF"> <input type="password" name="pwd"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">Email:</td> <td bgcolor="#FFFFFF"> <input type="text" name="email"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">電 話:</td> <td bgcolor="#FFFFFF"> <input type="text" name="tel"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">地 址:</td> <td bgcolor="#FFFFFF"> <input type="text" name="address"> </tr> <tr> <td align=right bgcolor="#FFFFFF" > <input type="submit" name="submit" value="注 冊"> </td> <td align=left bgcolor="#FFFFFF"> <input type="reset" name="submit" value="重 寫"> </td> </tr> </table> </form>
Fichier complet de la page d'inscription, code reg.php?:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>圖書系統(tǒng)注冊頁面</title> <style> body,td,th {font-family: 微軟雅黑;font-size: 9px;color: #222;} body {background-color: #FFFFFF;line-height:20px;} a:link {color: #222;text-decoration: none;} a:visited {text-decoration: none;color: #222;} a:hover {text-decoration: underline;color: #FF0000;} a:active {text-decoration: none;color: #999999;} </style> </head> <body> <form name="form1" method="post" action="" enctype='multipart/form-data' onSubmit="return checkreg()" > <table width="" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <th colspan="2" bgcolor="#FFFFFF"><font size="5">用 戶 注 冊 界 面</font></th> </tr> <tr> <td width="100px" align="right" bgcolor="#FFFFFF">姓 名:</td> <td width="100px" bgcolor="#FFFFFF"> <input type="text" name="name"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">密 碼:</td> <td bgcolor="#FFFFFF"> <input type="password" name="password"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">確認(rèn)密碼:</td> <td bgcolor="#FFFFFF"> <input type="password" name="pwd"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">Email:</td> <td bgcolor="#FFFFFF"> <input type="text" name="email"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">電 話:</td> <td bgcolor="#FFFFFF"> <input type="text" name="tel"> </tr> <tr> <td align="right" bgcolor="#FFFFFF">地 址:</td> <td bgcolor="#FFFFFF"> <input type="text" name="address"> </tr> <tr> <td align=right bgcolor="#FFFFFF" > <input type="submit" name="submit" value="注 冊"> </td> <td align=left bgcolor="#FFFFFF"> <input type="reset" name="submit" value="重 寫"> </td> </tr> </table> </form> </body> </html>