8. Register Reg. php3
<?
Require ("common. php3 ");
Require ("mail. php3 ");
If ($ submit ){
If ($ id = "") error ("Enter your registered username! ");
Elseif (! Eregi ("^ [0-9a-za_z] + $", $ id) error ("your username cannot contain other characters! ");
Elseif ($ Password = "") error ("enter your password! ");
Elseif ($ password <> $ password1) error ("Your password is incorrect! ");
Elseif ($ name = "") error ("enter your name! ");
Elseif ($ mail = "") error ("Enter your email address! ");
Else {
$ DBm = dbmopen ("class", "W ");
If (dbmexists ($ dBm, $ id) error ("this user name has been registered with someone else! ");
Else {
$ Intro = nl2br ($ intro );
$ DATA = "$ name |! :! | $ Nickname |! :! | $ Mail |! :! | $ Home |! :! | $ OICQ |! :! | $ ICQ |! :! | $ Add |! :! | $ Tel |! :! | $ Birth |! :! | $ Job |! :! | $ Intro |! :! | $ Sex ";
Dbminsert ($ dBm, $ id, $ data );
$ Pwd = dbmopen ("password", "W ");
Dbminsert ($ PWD, $ id, $ password );
}
Dbmclose ($ dBm );
$ Sendmsg = "Welcome to register n ";
$ Sendmsg. = "The following is your registration information: N ";
$ Sendmsg. = "User name: $ IDN user password; $ passwordn ";
$ Sendmsg. = "= "================== ";
$ Sendmsg. = "Registration Name: $ Namen registration nickname: $ nicknamen registration Email: $ mailn Homepage Address: $ homen ";
$ Sendmsg. = "Your OICQ: $ oicqn your ICQ: $ icqn contact address: $ addn contact number: $ teln ";
$ Sendmsg. = "Your Birthday: $ birthn your career: $ jobn your gender; $ sexn your profile: N $ intronn ";
$ Sendmsg. = "= "==================== ";
$ Sendmsg. = "Welcome to register" Shenzhen high school 2000 High School (12) Class transcript ";
$ Sendmsg. = "Login address: http://5212.net/class ";
Mail2 ("Welcome to register the transcript of the 2000 Shenzhen High School (12)", $ sendmsg, $ mail );
Header ("Location: Index. php3 ");
}
} Else {
?> <! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML> <Meta content = "text/html; charset = gb2312" http-equiv = Content-Type>
<LINK rel = "stylesheet" href = "style.css">
<Meta content = "mshtml 5.00.2614.3500" name = generator>
</Head> <body bgcolor = "# ffffff" topmargin = 0>
<Table border = 0 cellpadding = 0 cellspacing = 0 width = "100%"> <br>
<Div align = center> </div> <center> <tbody> </center>
</Table>
<Table border = 0 cellpadding = 0 cellspacing = 0 width = "60%" align = "center">
<Tbody> <tr valign = top>
<TD bgcolor = #000000 width = "100%" Height = "336">
<Div align = center>
<Table border = 0 cellpadding = 4 cellspacing = 1 Height = 390 width = 586>
<Tbody>
<Tr>
<TD align = middle bgcolor = # 2f5e8c colspan = 2 Height = 14 valign = top> <form method = "Post" Action = "Reg. php3 "> <font color = # ffffff> register an ICP filing </font> </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 150> Registered User name: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 400>
<Input class = stedit maxlength = 10 name = ID size = 23>
* Required </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your password: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 10 name = PASSWORD size = 23 type = "password">
* Required </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> duplicate password: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input type = "password" class = "stedit" name = "password1" size = "23" value = "">
* Required </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> nickname: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 20 name = nickname size = 23>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> Email: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 30 name = Mail size = 23>
* Required </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your OICQ: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 9 name = OICQ size = 23>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your home page: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 50 name = home size = 23 value = "http: //">
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your ICQ: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 10 name = ICQ size = 23>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your name: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 10 name = Name size = 23>
* Required </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your phone number: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 20 name = Tel size = 23>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> Date of birth: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 11 name = birth size = 23>
* Similar to 2000-10-10 </TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> contact address: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Input class = stedit maxlength = 50 name = add size = 23>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your career: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Select name = "job">
<Option value = ""> Student </option>
<Option value = ""> </option>
<Option value = "value"> </option>
</SELECT>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> your gender: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Select name = "sex">
<Option value = "Jun male"> Jun male </option>
<Option value = "pretty girl"> pretty girl </option>
<Option value = "value"> </option>
</SELECT>
</TD>
</Tr>
<Tr>
<TD align = middle bgcolor = # ffffff Height = 25 width = 121> Personal Profile: </TD>
<TD align = left bgcolor = # ffffff Height = 25 width = 486>
<Textarea class = "stedit" name = "Intro" Cols = "40" rows = "4"> </textarea>
</TD>
</Tr>
<Tr bgcolor = # ffedc8>
<TD bgcolor = # ffffff colspan = 2>
<Div align = "center">
<Input type = "Submit" name = "Submit" value = "Confirm application" class = "stbtm">
<Input type = "reset" name = "reset" value = "registration RESET" class = "stbtm">
</Div> </form>
</TD>
</Tr>
</Tbody>
</Table>
</Div> </tr> </tbody> </table> <br> <tr> <TD> </tr>
</Body>
</Html>
<?
}
?>
9. Create the database file run. php3
<?
$ DBm = dbmopen ("class", "C ");
Dbmclose ($ dBm );
$ DBm = dbmopen ("password", "C ");
Dbmclose ($ dBm );
?>