##Field name | id | username | userpwd |
Field type | ##int | varchar | varchar |
Field length10 | 20 | 20 | |
Field description | Number | Username | Password |
Next, let’s create the database
Database creation
We are using phpMyAdmin To create a simple database
First log in to the database. The username and password were set when we installed the database. My username and password are both root
After successful login, click Database on the top page , Then fill in the name of the database we want to create under the new database , and select utf8_general_ci for encoding (multi-language, case-insensitive)
#Click to create:
Now we create a data table containing three fields in the databaseClick Execute and fill in the details of each field ( Note: You need to choose an auto-increment for the id field, that is, select the option A_I):
##After filling in, click Save:
Okay, at this point, the database required for this project has been built
Note: If you can’t see the picture clearly, right-click on the picture Select View Picture to see the big pictureNext Section
<!DOCTYPE html>
<html>
<head>
<title>php.cn</title>
<meta charset="utf-8" />
<style>
.box{
width:250px;
height:120px;
background:#f0f0f0;
}
</style>
</head>
<body>
<!-- 注册界面 register.php-->
<div class="box">
<form action="regcheck.php" method="post">
<table>
<tr>
<td align="right">用户名:</td>
<td><input type="text" name="username" value="请输入用户名" maxLength="6"/></td>
</tr>
<tr>
<td align="right">密 码:</td>
<td><input type="password" name="userpwd" maxLength="6"/></td>
</tr>
<tr>
<td align="right">确认密码:</td>
<td><input type="password" name="confirm" maxLength="6"/></td>
</tr>
<tr>
<td colspa="2" align="right"><input type="Submit" name="Submit" value="注册"/></td>
</tr>
</table>
</form>
</div>
</body>
</html>