A DEMO WEBSITE

The source code for this demo web site that includes HTML, CSS, JavaScript, PHP can be downloaded from two my ebooks:

How to Build Your Own Web Site from Scratch

Learn PHP Programming by Examples

Also, I have the following eBooks for kindle on amazon.com:

Learn SQL Programming By Examples

Visual Basic Programming By Examples

The Easiest Way to Understand Algebra

The Easiest Way to Understand Chemistry

Geometry For Parents

You can edit style.css to change colors.

The PHP code includes a user registration and authorization and visitors comments.

Modification is required for conn.php file, because a connection to a database code may be different on different hosts.

For this site, I use Fatcow.com and my connection file is like that:

<?php
$link = mysql_connect('youhostlogim.fatcowmysql.com', 'user', 'password');
if (!$link) {
              die('Could not connect: ' . mysql_error());
}
//echo 'Connected successfully';
mysql_select_db(mydb);
$domain_email="webmaster@yourdomain.com";
?>

In most other cases connection file is like that:

<?php
$host="localhost";
$user="youruser";
$password="yourpassword";
$database="yourdatabase";
mysql_connect( $host, $user, $password)
              or die ( 'Unable to connect to server.' );
              mysql_select_db($database )
              or die ( 'Unable to select database.' );
$domain_email="webmaster@yourdomain.com";
?>

The domain email required to send an activation link to a user email.

1. You have to create a database and users in your hosting control panel.

2 You have to set an email account.

3. You have to create a usernames table, a pages table and a comments table. (Instruction is in the demosite.zip file)

4. You have to insert records in the usernames table and pages table. (Included in zip file)

You can run my demo website on your local PC, but system will not be able to send activation message to a user email. and user account will not be active. You may insert 1 in the user active field manually to make the user active.

To explore this demo website, you may register with your real email and see how the registration and authentication sistem is working.

Don't worry, I will not use your email in any way or give it to other party.

Try to change password, try the forget password feature. A new password will be sent to your email.

Some email providers block email sent by computer. Make sure to check spam box for activation email. If it does not help, add the email address master@configure-all.com to your contact list.

For demo, I created two users: a regular user James Williams (username jwill) and an admin user John Smith (username jsmith). Initially, I created passwords ´password´ for both of them. if someone changes the password for these two user, you can change it back by clicking the Reset Password link on the bottom menu.

The admin user has permission to approve and delete regular users comments. A regular user may delete only her own comments.

There is a file notallowed_word.php, where you can enter words that you do not want to allow in comments. When comments include a not allowed word, a message "A rude, offensive slang is not allowed!" is displayed and comments will not be saved in the database. For testing purpose, I entered 3 words: cake, beer and cash.

Try to play with comments. Try to approve or delete comments.

Good luck!