Use PHP to connect to the database to operate the user registration, review and login page, php user registration
Registration page
<Body>
<H1> registration page <Form action = "zhucechuli. php" method = "post">
<Div> User name: <input type = "text" name = "uid"/> </div>
<Div> password: <input type = "text" name = "pwd"/> </div>
<Div> name: <input type = "text" name = "name"/> </div>
<Div> Gender: <input type = "text" name = "sex"> </div>
<Div> birthday: <input type = "text" name = "birthday"> </div>
<Input type = "submit" value = "register"/>
</Form>
</Body>
Registration processing page
<? Php
$ Uid = $ _ POST ["uid"];
$ Pwd = $ _ POST ["pwd"];
$ Name = $ _ POST ["name"];
$ Sex = $ _ POST ["sex"];
$ Birthday = $ _ POST ["birthday"];
Include ("LZY. class. php ");
$ Db = new LZY ();
$ SQL = "insert into zhuce VALUES ('{$ uid}', '{$ pwd}', '{$ name}', '{$ sex }', '{$ birthday}', 0 )";
If ($ db-> query ($ SQL, 0 ))
{
Header ("location: zhuceyemiandenglu. php ");
}
Else
{
Echo "registration failed! ";
}
Logon page
<Body>
<H1> page logon <Form action = "zcdlchuli. php" method = "post">
<Div> User name: <input type = "text" name = "uid"/> </div>
<Div> password: <input type = "password" name = "pwd"/> </div>
<Div> <input type = "submit" value = "Logon"/> </div>
</Form>
</Body>
Registration logon process page
<? Php
$ Uid = $ _ POST ["uid"];
$ Pwd = $ _ POST ["pwd"];
Include ("LZY. class. php ");
$ Db = new LZY ();
$ SQL = "select * from zhuce where uid = '{$ uid }'";
$ Arr = $ db-> Query ($ SQL );
If ($ arr [0] [1] ==$ pwd &&! Empty ($ pwd ))
{
If ($ arr [0] [5])
{
Header ("location: zcmain. php ");
}
Else
{
Echo "this user has not passed review! ";
}
}
Else
{
Echo "Logon Failed! ";
}
Registration page
<Body>
<H1> User review
<Table width = "100%" border = "1" cellpadding = "0" cellspacing = "0">
<Tr>
<Td> User Name </td>
<Td> name </td>
<Td> gender </td>
<Td> birthday </td>
<Td> operation </td>
</Tr>
<? Php
Include ("LZY. class. php ");
$ Db = new LZY ();
$ SQL = "select * from zhuce ";
$ Arr = $ db-> Query ($ SQL );
Foreach ($ arr as $ v)
{
$ Str = $ v [5]? "<Span style = 'background-color: green'> passed </span>": "<a href = 'zctongguo. php? Uid = {$ v [0]} '> pass </a> ";
Echo "<tr>
<Td >{$ v [0]} </td>
<Td >{$ v [2]} </td>
<Td >{$ v [3]} </td>
<Td >{$ v [4]} </td>
<Td >{$ str }</td>
</Tr> ";
}
?>
</Table>
</Body>
</Html>
Approved code
<? Php
$ Uid = $ _ GET ["uid"];
Include ("LZY. class. php ");
$ Db = new LZY ();
$ SQL = "update zhuce set isok = 1 where uid = '{$ uid }'";
If ($ db-> Query ($ SQL, 0 ))
{
Header ("location: zcmain. php ");
}
Else
{
Echo "failed to pass! ";
}