PHP+DBM's Alumni Program (4) _php Foundation
Last Update:2017-01-19
Source: Internet
Author: User
8. Registration Document REG.PHP3
?
Require ("common.php3");
Require ("mail.php3");
if ($submit) {
if ($id = = "") Error ("Please fill in your registered user name!") ");
ElseIf (!eregi ("^[0-9a-za_z]+$", $id)) error ("Your username cannot contain other characters!") ");
ElseIf ($password = = "") Error ("Please fill in your password!") ");
ElseIf ($password <> $password 1) error ("Your password is not filled out correctly!" ");
ElseIf ($name = = "") Error ("Please fill in your name!") ");
ElseIf ($mail = = "") Error ("Please fill in your email address!") ");
else{
$DBM =dbmopen ("Class", "W");
if (Dbmexists ($DBM, $id)) error ("This user name has been registered to others!" ");
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 Shenzhen Middle School 2000 High School (12) class alumni" n ";
$sendmsg. = "Below is your registration information: n";
$sendmsg. = "Username: $idn user password; $passwordn";
$sendmsg. = "=====================================================";
$sendmsg. = "Registered Name: $namen Registered Nickname: $nicknamen registered mailbox: $mailn Homepage Address: $homen";
$sendmsg. = "Your OICQ: $oicqn your ICQ: $icqn Contact Address: $ADDN Tel: $teln";
$sendmsg. = "Your Birthday: $birthn your Occupation: $jobn your gender; $sexn your personal introduction: N$intronn";
$sendmsg. = "======================================================";
$sendmsg. = "Welcome to the registration of Shenzhen Secondary School (12) class alumni";
$sendmsg. = "Landing address: http://5212.net/class/";
MAIL2 ("Welcome to Shenzhen Middle School 2000 High School (12) class alumni", $sendmsg, $mail);
Header ("Location:index.php3");
}
}else{
? ><! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML><HEAD><TITLE> Alumni User Registration </TITLE>
<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>
<table border=0 cellpadding=0 cellspacing=0 width= "100%" ><BR>
<div align=center></div><center><tbody></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 > Registered Alumni </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>
* Must fill in </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" >
* Must fill in </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= "" value= "" >
* Must fill in </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>
* Must fill in </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 homepage: </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>
* Must fill in </td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> your phone: </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 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" > Student </option>
<option value= "Teacher" > Teacher </option>
<option value= "Other" > Other </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= "Handsome" > Handsome boys </option>
<option value= "Pretty Girl" > Pretty girl </option>
<option value= "Other" > Other </option>
</select>
</td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> profile: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<textarea class= "Stedit" name= "Intro" cols= "" rows= "4" ></textarea>
</td>
</tr>
<tr bgcolor= #ffedc8 >
<TD bgcolor= #ffffff colspan=2>
<div align= "center" >
<input type= "Submit" name= "Submit" value= "Confirmation 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></TD></TR>
</BODY>
</HTML>
?
}
?>
9, the establishment of the database file run.php3
?
$DBM =dbmopen ("Class", "C");
Dbmclose ($DBM);
$DBM =dbmopen ("Password", "C");
Dbmclose ($DBM);
?>