PHP+DBM's Yearbook Program (4) _php tutorial

Source: Internet
Author: User
Tags sendmsg
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 ...

  • Related Article

    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.