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 user name cannot contain other characters!") ");
ElseIf ($password = = "") Error ("Please fill in your password!") ");
ElseIf ($password <> $password 1) error ("Your password is not filled in 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 username has already been registered to 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" Shenzhen Middle School 2000 session High School (12) class Yearbook "n";
$sendmsg. = "Below is your registration information: n";
$sendmsg. = "User name: $idn user password; $passwordn";
$sendmsg. = "=====================================================";
$sendmsg. = "Registered Name: $namen Registered Nickname: $nicknamen registered Email: $mailn Home 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 register" Shenzhen Middle School 2000 session High School (12) class yearbook ";
$sendmsg. = "Login address: http://5212.net/class/";
MAIL2 ("Welcome to register" Shenzhen Middle School 2000 session High School (12) Class Yearbook ", $sendmsg, $mail);
Header ("Location:index.php3");
}
}else{
?>
<title>Yearbook User Registration</title>
}
?>
9, the establishment of the database file run.php3
$DBM =dbmopen ("Class", "C");
Dbmclose ($DBM);
$DBM =dbmopen ("Password", "C");
Dbmclose ($DBM);
?>
http://www.bkjia.com/PHPjc/316228.html www.bkjia.com true http://www.bkjia.com/PHPjc/316228.html techarticle 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 user ...