PHP+DBM's Alumni Program (4)

Source: Internet
Author: User
Tags mail require reset sendmsg
Program 8, registration file 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>
&LT;TD bgcolor= #000000 width= "100%" height= "336" >
<div align=center>
<table border=0 cellpadding=4 cellspacing=1 height=390 width=586>
<TBODY>
<TR>
&LT;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>
&LT;TD align=middle bgcolor= #ffffff height=25 width=150> Registered user name: </TD>
&LT;TD align=left bgcolor= #ffffff height=25 width=400>
<input class=stedit maxlength=10 Name=id size=23>
* Must fill in </TD>
</TR>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your password: </td>
&LT;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>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> duplicate password: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input type= "Password" class= "Stedit" name= "Password1" size= "" value= "" >
* Must fill in </td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121>nickname: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=20 name=nickname size=23>
</td>
</tr>
<TR>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> Email: </TD>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=30 Name=mail size=23>
* Must fill in </TD>
</TR>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your OICQ: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=9 Name=oicq size=23>
</td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your homepage: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=50 name=home size=23 value= "http://" >
</td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your ICQ: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=10 Name=icq size=23>
</td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your name: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=10 name=name size=23>
* Must fill in </td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your phone: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=20 Name=tel size=23>
</td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> Date of birth: </td>
&LT;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>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> Contact Address: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=50 Name=add size=23>
</td>
</tr>
<tr>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your career: </td>
&LT;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>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> your gender: </td>
&LT;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>
&LT;TD align=middle bgcolor= #ffffff height=25 width=121> profile: </td>
&LT;TD align=left bgcolor= #ffffff height=25 width=486>
<textarea class= "Stedit" name= "Intro" cols= "" rows= "4" ></textarea>
</td>
</tr>
<tr bgcolor= #ffedc8 >
&LT;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);
?>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.