| Downloaded from www.biorust.com on Wed Feb 08, 2012 16:47:14 |
![]() | |
| A Complete Membership System Tutorial Author - Scrowler (http://forums.biorust.com/member.php?userid=66) |
Hello, ladies and gentleman, to one of my biggest tutorials yet!
In this multi-page article I’m going to
show you how to set up the server side scripting for a complete
membership system, including everything from registration, to changing your
password, validation emails, etc.
First of all I'll outline what I’m going to cover in this tutorial:
MySQL Table Configuration
Registration script
Login script
Activation script
Members page
Resending validation emails
Logout script
Processing member commands
This set of scripts includes 32bit md5() password encryption and the use of sha1() 40bit encryption to generate a 40 digit hash that we can use for the activation code. You can download all scripts used in this tutorial here, although you should be aware that I've added a nice CSS layout and collapsing menus into the final scripts to make things look a bit more spanky.
MySQL Table Configuration
The first step is to set up your MySQL database. If you have access via
control panel software (i.e. cPanel), you should set everything up through there,
and add your user as usual. Otherwise, use
phpMyAdmin,
or write some SQL syntax to do it, as I will only be providing you with SQL to
set up the table.
Our database setup consists of a single table with 9 fields: User ID, Username, Password, Full
name, Email, Date, IP when registering, Whether activated and the Activation
key.
In the same order, we will be using these data types: int(11) PRIMARY auto_increment, Text, VARCHAR(32), Text, Text, Text, Text, int(1) DEFAULT 0,
VARCHAR(40). Bamboozled? Not to worry, here’s the SQL syntax you can use to
do it automatically for you:
CREATE TABLE `Users` (
`id` int(11) NOT NULL auto_increment,
`Username` text NOT NULL,
`Password` varchar(32) NOT NULL default '',
`Name` text NOT NULL,
`Email` text NOT NULL,
`Date` text NOT NULL,
`IP` text NOT NULL,
`Actkey` varchar(40) NOT NULL default '',
`Activated` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
)
With the database now set up, all we have to do is connect to it! In our
scripts this is controlled by a single file, config.php, which connects
to the server and opens the correct database.
Configuration Script (config.php)
|
<?php $l = mysql_connect ( "localhost" , "yourmysqlUser" , "password" ) or die("Error connecting: <br><br>".mysql_error()); mysql_select_db( "yourdatabase" ) or die("Error getting db: <br><br>".mysql_error()); ?> |
The connection is defined in a variable because we want to close it later, and we need a link identifier to use in mysql_close(). So, with the basics covered, its on to the coding of the individual scripts...
Registration Script (register.php)
I
think the best way for me to do this is to give you a big lump of code,
then tell you what each part does. So, let’s do that:
|
<?php include 'config.php'; if(isset($_POST['submit'])) { $first = addslashes(trim($_POST['firstname'])); $surname = addslashes(trim($_POST['surname'])); $username = addslashes(trim($_POST['username'])); $email = addslashes(trim($_POST['email'])); $pass = addslashes(trim($_POST['password'])); $conf = addslashes(trim($_POST['confirm'])); $ip = $_SERVER['REMOTE_ADDR']; $date = date("d, m y"); if ( $_POST['password'] == $_POST['confirm'] ) {}else{ echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>'; echo '<script>history.back(1);</script>'; exit; } $password = md5($pass); if ((((( empty($first) ) || ( empty($surname) ) || ( empty($username) ) || ( empty($email) ) || ( empty($password) ))))) { echo '<script>alert("One or more fields was left empty, please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } if((!strstr($email , "@")) || (!strstr($email , "."))) { echo '<script>alert("You entered an invalid email address. Please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } $q = mysql_query("SELECT * FROM Users WHERE Username = '$username'") or die(mysql_error()); if(mysql_num_rows($q) > 0) { echo '<script>alert("The username you entered is already in use, please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } $name = $first . ' ' . $surname; $actkey = mt_rand(1, 500).'f78dj899dd'; $act = sha1($actkey); $query = mysql_query("INSERT INTO Users (Username, Password, Name, Email, Date, IP, Actkey) VALUES ('$username','$password','$name','$email','$date','$ip','$act')") or die(mysql_error()); $send = mail($email , "Registration Confirmation" , "Thank you for registering with YourWebsite.\n\nYour username and password is below, along with details on how to activate your account.\n\nUser: ".$username."\nPass: ".$pass."\n\nClick the link below to activate your account:\nhttp://EDITTHISURL.COM/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks", "FROM: auto@mailer.com"); if(($query)&&($send)) { echo ' <html> <head> <title>Success</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="success"> <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p> <p><a href="login.php">Click here</a> to login once you have activated.</p> </div> </body> </html> '; } else { echo ' <html> <head> <title>Error</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="error"> <p>We are sorry, there appears to be a problem with our script at the moment.</p> <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.' | Full name: '.$name.'</p> <p>Please try again later.</p> </div> </body> </html> '; } } else { ?> <html> <head> <title>Register</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the registration page</div> <br> <div id="main"> <p>Welcome to the registration, fill out the form below and hit Submit. All fields are required,so fill them all out! </p> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="50%">First name </td> <td width="50%"><input name="firstname" type="text" id="firstname"></td> </tr> <tr> <td>Surname</td> <td><input name="surname" type="text" id="surname"></td> </tr> <tr> <td>Email Address </td> <td><input name="email" type="text" id="email"></td> </tr> <tr> <td>Username</td> <td><input name="username" type="text" id="username"></td> </tr> <tr> <td>Password</td> <td><input name="password" type="password" id="password"></td> </tr> <tr> <td>Confirm Password </td> <td><input name="confirm" type="password" id="confirm"></td> </tr> <tr> <td>Register</td> <td><input name="submit" type="submit" class="textBox" value="Submit"></td> </tr> </table> </form> Upon confirmation of your details, you will be sent an email containing your username, password and details on how to activate your account so as to be able to use this website. </div> </div> </body> </html> <? } mysql_close($l); ?> |
Our script starts with the essential first step - i.e. including the connection file
config.php. The rest of the script is then fairly simple, and takes user
submitted data, inserts it into pre-defined variables, and then TRIMs off each
variable to remove any characterless space at either end of the values.
Once these simple variable-handling steps have been performed, the script then
runs through a few basic IF statements to protect the integrity of our data. In
our case, these statements ensure that the email address has an @ and a . in it,
the passwords are the same, the username is not already taken, and no fields are
empty. Then it processes the registration and inserts all the data, including our
newly generated activation key, which is a sha1() hash of a randomly generated
number between 1 and 500 with some random letters added onto the end of it.
Since the table’s column “Activated” has a default value of 0, the user is not
activated until he/she clicks his link with this value in it.
With all these steps complete, the script then sends out the confirmation
e-mail. You must make sure you change some of the details if you directly
use our scripts though - just look for YourWebsite and CHANGETHISURL.COM,
and change them accordingly.
Depending on the data entered, the script will finally display a message from a variety of errors or confirmation messages
reporting any pertinent information (or just a nice big 'thank you' message).
Login Script (login.php)
|
<?php session_start(); include 'config.php'; if(isset($_POST['login'])) { $username = trim(addslashes($_POST['username'])); $password = md5(trim($_POST['password'])); $query = mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); // now we check if they are activated if(mysql_num_rows($query) > 0) { if($row['Activated'] > 0) { $_SESSION['s_logged_n'] = 'true'; $_SESSION['s_username'] = $username; $_SESSION['s_name'] = $row['Name']; header("Location: member.php"); } else { echo ' <html> <head> <title>Login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="error"><p>Sorry, you must activate your account first. Please check your email for the email.</p> <p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p></div> </body> </html> '; } } else { echo ' <html> <head> <title>Login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="error"><p>There was an error processing your login, it appears that your username and/or password was incorrect. Please try again.</p> <p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p> </div> </body> </html> '; } } else { ?> <html> <head> <title>Login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the login page</div><br> <div id="main"> <p>You must login to view this page. Enter your username and password below and hit submit:</p> <form method="post" action="<?= $_SERVER['PHP_SELF'] ?>"> <p>Username:<br> <input name="username" type="text" Cid="username"> <p>Password:<br> <input name="password" type="password" id="password"> </p> <p> <input name="login" type="submit" id="login" value="Submit"> </p> </form> <p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p> <p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p> </div> </div> </body> </html> <? } mysql_close($l); ?> |
As you can probably guess, this script utilizes PHP SESSIONS, so a session is started with the session_start() command, and then config.php is included as before. We then check whether the user has submitted the form or not. If they have, it is processed, login details are checked, and the session variables are set to confirm that he/she is logged in. If this is not the case, the user is presented with a nice form instead. Nice and simple!
Activation Script (activate.php)
Not
many membership systems include activation scripts, but I wanted to show
you how to make yours “unspammable” and this is the easiest way. To put it
simply, the user must
enter a valid e-mail address otherwise he/she will not be able to validate their
account and will not be able to login! Its a nice way to ensure that all your
e-mail addresses are valid. Here’s the code you need:
|
<?php include 'config.php'; $id = $_GET['id']; $query = mysql_query("SELECT * FROM Users WHERE Actkey = '$id' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); if(mysql_num_rows($query) > 0){ $user = $row['id']; $do = mysql_query("UPDATE Users SET Activated = 1 WHERE id = '$user' LIMIT 1") or die(mysql_error()); $send = mail($row['Email'] , "Activation Confirmation" , "Thank you for activating your account, you are now fully registered and able to use our services.\n\nTo login, click the link below:\nhttp://CHANGETHISURL.COM/login.php" , "FROM: auto@mailer.com"); if(($do)&&($send)) { echo '<link href="style.css" rel="stylesheet" type="text/css"> <div id="success"> <p>Activation successful! A confirmation email has been dispatched. You can now login!</p> <p><a href="login.php">Click here</a> to goto the login page.</p> </div>'; } else { echo '<link href="style.css" rel="stylesheet" type="text/css"> <div id="error"> <p>We are sorry, there appears to be an error processing your activation. Please try again later.</p> </div>'; } } else { echo '<link href="style.css" rel="stylesheet" type="text/css"> <div id="error"> <p>Sorry, your activation code was incorrect. Please try again.</p> </div>'; } mysql_close($l); ?> |
This script takes the header
variable “id” which is (when the script is run properly) a 40 character
sha1() hash of a randomly generated number and some random letters.
There is no need to process individual ID numbers in this script as we
can just search through the database to
find a user with the exact same activation key - the chances of two
users awaiting validation having the same hashed code is infinitesimally
small. Of course, once the appropriate user has been found,
his/her Activated value will be set to 1, thus activating/validating
them. If not, the
user gets an error message.
The most important thing to remember in this script is that you must
edit the mail() function and change the URL to your URL instead of the
text “CHANGETHISURL.COM” - otherwise the user will not know where or how
to login!
That was simple wasn't it? Activation is just
there so that the registration form can’t be spammed, and ensures an
authentic registrant. If
you want to be superior, you could write yourself an administration
panel with a function to delete all unactivated accounts that have been
sitting for X amount of time, because when you register, it logs the
date! This opens up a world of possibility for future modifications!
Members Page (member.php)
This is the page
the user will be shown when they log in. In my code I have separated all the
menu structure into a separate file, menus.php, and added it back in by
way of an INCLUDE to keep the source code below as simple as possible. You can either use the same code/idea in your script
or make your own navigation, but you need to make sure that the following 3
links are included to make use of the inbuilt
features in this members only page:
member.php?change=password – This will show a form to change your
password
member.php?change=email – This will show a form to change your email
address.
Note: both of the features above deactivate the user when the script processes,
and they must re-activate via email.
member.php?change=account – This will shut the account down & delete it.
This shows a confirmation message before referring itself to processing for
account deletion (see processing.php for more details).
|
<?php session_start(); if($_SESSION['s_logged_n'] == 'true'){ include 'process.php'; ?> <html> <head> <title>Members Page</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">The member page</div><br> <div id="container"> <? include 'menus.php' ?> </div> <div id="spacer"> </div> <div id="memmain"> <?php switch($_GET['change']){ case 'password': echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p>Current password:<br> <input name="current" type="password"></p> <p>New password:<br> <input name="new" type="password"></p> <p>Confirm new password:<br> <input name="confirm" type="password"></p> <p><input type="submit" value="Change Password" name="changepassword"></p> </form> '; break; case 'email': echo '<p> WARNING! - By changing your email address you will have to re-validate. Make sure you email address is 100% correct.</p> <form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p>Current email:<br> <input name="current" type="text"></p> <p>New email:<br> <input name="new" type="text"></p> <p>Confirm new email:<br> <input name="confirm" type="text"></p> <p><input type="submit" value="Change Email" name="changeemail"></p> </form> '; break; case 'account': echo '<p> WARNING - By closing your account, you will not be able to login again under this account. Press the button below to confirm you wish to close your account</p> <form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p><input type="submit" value="Close Account" name="closeaccount"></p> </form> '; break; default: echo '<p>Welcome to the super secret members only control panel!</p>'; } ?> </div> </body> </html> <?php } else { header("Location: login.php"); } ?> |
The first
crucial IF statement checks the session containing data to ensure that
the user is allowed to view the page. If the user is properly
authenticated, the page will be shown. Otherwise, the page will re-refer
to the login.
The rest of the main page is pretty simple and you can structure it how
you like - providing, of course, that you include the appropriate links
mentioned above. Adding extra options is as easy as adding a few lines
of code to the switch. The switch
statement chooses what to do depending on the header variable “change”.
It has 3 inbuilt forms and a default clause which initiates when $_GET[‘change’]
is empty.
Resending Validation E-Mails (resend.php)
When running a script system that features user authentication, one essential
feature is a script that resends the validation e-mail, ensuring that if the
e-mail doesn't reach the recipient (due to network connectivity problems,
over-eager anti-spam systems, etc) then it can be re-sent with ease by simply
filling out a form.
|
<?php include 'config.php'; if(isset($_POST['resend'])) { $email = trim($_POST['email']); $query = mysql_query("SELECT Actkey FROM Users WHERE Email = '$email' LIMIT 1") or die(mysql_error()); while($row = mysql_fetch_array($query)){ $act = $row['Actkey']; if(mysql_num_rows($query) > 0) { $send = mail($email , "Activate your account" , "Thank you for registering with YourWebsite.\n\nClick the link below to activate your account:\nhttp://CHANGETHISURL.COM/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks", "FROM: auto@mailer.com"); if($send){ echo ' <html> <head> <title>Success</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the resend activation email page</div> <br> <div id="success"> <p>The validation email was successfully sent. <a href="login.php">Click here</a> to login once you have activated.</p> </div> </div> </body> </html> '; } else { echo ' <html> <head> <title>Error</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the resend activation email page</div> <br> <div id="error"> <p>Ha, what an act. There has been an error processing your activation email. Please contact the administrator.</p> </div> </div> </body> </html> '; } } else { echo ' <html> <head> <title>Error</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the resend activation email page</div> <br> <div id="error"> <p>Sorry, your email was not found in the database, please enter an email address that you have registered with and not recieved and email with.</p> </div> </div> </body> </html> '; } } } else { ?> <html> <head> <title>Resend validation email</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the resend activation email page</div> <br> <div id="main"> <p>Ok, so your activation email didn't get sent? DAMN S**T C*H(#@ ((@J no, stop swearing, put that bottle down. You don't need it. We need each other. I'm here to resend your email, so enter your email address, and I will send the validation link to that email, provided you have registered ofcourse, if you are trying to hack me, what a sad guy, taking advantage of my emotions like that... jeez.</p> <form method="post" action="<?= $_SERVER['PHP_SELF'] ?>"> <p>Email:<br> <input name="email" type="text"> <p> <input name="resend" type="submit" id="resend" value="Resend"> </form> </p> Once you enter your email and hit resend, I will make sure your email is valid, then send you out your validation link. If it doesn't come, try me again! I'm not a one night stand you know... <p>By the way, I am very (case) sensitive so enter the email exactly as you registered with it. </p> </div> </div> </body> </html> <? } mysql_close($l); ?> |
As you can probably deduce, this script features a
logic switch, meaning that when the user first loads the page they will
be shown a form, and when they submit the data, the page will process
that data instead. This involves searching
the database for the user account with the email address provided. If it
is found, an e-mail is sent to the appropriate e-mail address with the user’s
activation key in a URL that they can activate. As before, though, you
must change that URL in the mail() function to reflect your server's
settings!
If the email address isn’t found the user gets an error message. You may have noticed I use PHP_SELF as the form method in all the forms so far
- That is basically
just telling the form to process onto itself. Its a convenient
method that reduces the overall number of scripts needed for the whole
membership system.
Logout Script (logout.php)
Well, this is one
of the simplest scripts ever, and doesn’t involve much work:
|
<?php session_start(); $_SESSION['s_logged_n'] = ''; $_SESSION['s_name'] = ''; $_SESSION['s_username'] = ''; session_destroy(); header("Location: login.php"); ?> |
It starts sessions, sets all the sessions our scripts use to null, calls session_destroy() to kill the session, and then redirects to the login form. What else can I say?
Processing Member Commands (process.php)
This is the file that processes the member page options, allowing us to change
the password/email and shut accounts.
|
<?php include 'config.php'; if(isset($_POST['changepassword'])) { $current = trim($_POST['current']); $new = trim($_POST['new']); $confirm = trim($_POST['confirm']); $pw = md5($current); $query = mysql_query("SELECT * FROM Users WHERE Password = '$pw' LIMIT 1") or die(mysql_error()); if(mysql_num_rows($query) > 0) { while($row = mysql_fetch_array($query)) { if ( $_POST['new'] == $_POST['confirm'] ) {}else{ echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>'; echo '<script>history.back(1);</script>'; exit; } $password = md5($new); $do = mysql_query("UPDATE Users SET Password = '$password' WHERE Password = '$pw' LIMIT 1") or die(mysql_error()); $dotwo = mysql_query("UPDATE Users SET Activated = 0 WHERE Password = '$password' LIMIT 1") or die(mysql_error()); $send = mail($row['Email'] , "Password changed" , "Your password has been changed to: ".trim($_POST['new'])."\n\nYou can change it again via the members only panel, but first you must re-activate your account:\nhttp://CHANGETHISURL.COM/activate.php?id=".$row['Actkey']."\n\nDo not reply to this email, it is automated. Thanks." , "From: auto@mailer.com"); if((($do)&&($dotwo)&&($send))) { echo '<script>alert("Password changed. You will now be logged out and you must re-activate your account, check your email, a confirmation email has been sent.");</script>'; echo '<script>location.replace("logout.php");</script>'; exit; } else { echo '<script>alert("There appears to have been an error in the script. 1 or 2 of 3 things may have happened:\n\n• Your password could have been reset/changed\n• Your account could have been deactivated, see the resend validation email page\n• Your email may not have been sent.\n\nYou will now be logged out, if you are not able to login, reset your password using the form, or resend the validation email to activate your account again.\n\nWe are sorry for the inconvenience.");</script>'; echo '<script>location.replace("logout.php");</script>'; exit; } } } else { echo '<script>alert("Incorrect password.");</script>'; echo '<script>history.back(1);</script>'; exit; } } if(isset($_POST['changeemail'])) { $current = trim($_POST['current']); $new = trim($_POST['new']); $confirm = trim($_POST['confirm']); $query = mysql_query("SELECT * FROM Users WHERE Email = '$current' LIMIT 1") or die(mysql_error()); if(mysql_num_rows($query) > 0) { while($row = mysql_fetch_array($query)) { if ( $_POST['new'] == $_POST['confirm'] ) {}else{ echo '<script>alert("Your email addresses were not the same, please enter the same email to confirm.");</script>'; echo '<script>history.back(1);</script>'; exit; } $do = mysql_query("UPDATE Users SET Email = '$new' WHERE Email = '$current' LIMIT 1") or die(mysql_error()); $dotwo = mysql_query("UPDATE Users SET Activated = 0 WHERE Email = '$new' LIMIT 1") or die(mysql_error()); $send = mail($row['Email'] , "Email changed" , "Your email has been changed to: ".trim($_POST['new'])."\n\nYou can change it again via the members only panel, but first you must re-activate your account:\nhttp://CHANGETHISURL.COM/activate.php?id=".$row['Actkey']."\n\nDo not reply to this email, it is automated. Thanks." , "From: auto@mailer.com"); if((($do)&&($dotwo)&&($send))) { echo '<script>alert("Email changed. You will now be logged out and you must re-activate your account, check your email, a confirmation email has been sent.");</script>'; echo '<script>location.replace("logout.php");</script>'; exit; } else { echo '<script>alert("There appears to have been an error in the script. 1 or 2 of 3 things may have happened:\n\n• Your email could have been reset/changed\n• Your account could have been deactivated, see the resend validation email page\n• Your email may not have been sent.\n\nYou will now be logged out, if you are unable to login or cannot resend the validation email to either addresses, please contact the administrator.\n\nWe are sorry for the inconvenience.");</script>'; echo '<script>location.replace("logout.php");</script>'; exit; } } } else { echo '<script>alert("Incorrect email.");</script>'; echo '<script>history.back(1);</script>'; exit; } } if(isset($_POST['closeaccount'])) { $username = $_SESSION['s_username']; $do = mysql_query("DELETE FROM Users WHERE Username = '$username' LIMIT 1") or die(mysql_error()); if($do){ echo '<script>alert("Your account has now been closed, thank you for being with us. You will now be logged out.");</script>'; echo '<script>location.replace("logout.php");</script>'; exit; } else { echo '<script>alert("Your account has NOT been closed, there was an error in the processing of this script, you will now be redirected back, please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } } ?> |
This looks like a pretty huge script, but actually consists
of three main IF statements. This file gets included in the member.php page, so if one of the forms gets submitted this script detects it,
processes the correct code, and then dies peacefully so that unwanted code does
not get executed. The first two IF statements are very similar indeed - The first checks
that the
current password is correct, that the new and confirmed passwords are the same,
updates the database, deactivates the users account then gives the user a
message & redirects to be logged out. The second is the same except for e-mail
addresses, and sends an e-mail to the new e-mail address.
Once again, you must change the URL in the first and second mail() functions to
your URL. This is a stupid place to mention it (right at the end of the
tutorial) but you may want to define a variable that holds this URL, and just
include the variable each time instead of the URL. This can be done in under
five minutes.
Well, after numerous pages of code and explanations, we’re finished! If you have any
questions or comments, feel free to contact me on the
Creative Forums or click my name below to visit my profile where you can Private
Message or Email me. Registration may be required.
If you wish to download the source code files for this tutorial, click
here
to download a .ZIP file containing all of the files used above and a style.css
file to make your website look even snazzier. I hope this tutorial has helped
you!