DEMO WEBSITE



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

PHP Programming for Beginners

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 MySQLi extention to connect to MySQL database.

My host is Fatcow.com and my connection file is like that:

<?php

$link = mysqli_connect('configureallcom.fatcowmysql.com', 'user', 'password','database');

if (mysqli_connect_errno())
{
$msg="Failed to connect to MySQL: " . mysqli_connect_error();
}
$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 tutor@hardstuffez.com to your contact list.

For demo, I created two users: a regular user James Williams (username jwill) and 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.

Download a completed source code (HTML, CSS, JavaScript and PHP) for this website.

Good luck!