User Authentication, User Registration Script for free. PHP
By Sergey Skudaev
![]()
![]()
![]()
![]()
![]()
I am offering a set of PHP templates for your website authentication. Templates are included in auth.zip file. Additionally, style.css file is included for 3 columns page layout and web page template.
You do not have to know PHP programming to use my set of templates. To make your web site capable to register visitors and set to visitors different permissions you have to perform the following steps.
1. Create mail account on your hosting control panel.
How to set email account in your control panel
2. Create MySQL database and database users.
How to create MySQL database in your control panel
3. Create username table in MySQL database using phpMyAdmin. Detailed instruction will be provided.
Your hosting control panel has phpMyAdmin installed and you can use it right away to access you database and create tables. Open SQL window and paste my script included in the usernames.sql.txt file. Click Go button. The usernames table will be created.
Create auth directory in your web site root directory and unzip auth.zip file there. The Root directory is where all your web page files are stored. Usually it is public_html.
4. Edit "connect.php" file. Enter your database name, your user name, your user password created in step 2. Enter your hosting email address created in step 1.
It should looks like that:
<?php
$hostname = "localhost";
$dbuser = "myuser";
$dbpassword = "mypassword";
$dbname = "mydatabase";
$domain_email="webmaster@yourdomain.com";
?>
There should not be any space character after ?>
If you want that your particular web page was accessible only to registered users include the "auth.php" file on the top of this page. See the "protected_template.php" file as example. The web page must have extension .php and not .html.
If you want that your particular web page was accessible only to admin users, include the "adminauth.php" file on the top of this page. See the "admin_template.php" file as example. The web page must have extension .php and not .html.
I included webpagetemplate.php file that is an unsecured page template, the secured_template.php file that is accessible only to registered users and the admin_template.php file that is accessible only to users with the admin role. When your register yourself, you should set role to admin. You can do that in phpMyAdmin. Open username table, find your record and change role from user to admin. All the rest users will have role user and will not have access to admin pages. See how to use phpMyAdmn above.
I include style.css files to control web page design and layout and JavaScript files for user input validation.
Test your web site user registration. Create your account, login and password. Email with activation link will be sent to your user email. Open email and click the activation link. Your account will be activated. Log into your web site. Try to access pages with limited permissions before you login and after. Try to login as a regular user and as an admin.
If you cannot create database and usernames table or have any question, feel free to contact me by email: master@configure-all.com.
You should be aware that even though your web site users use login and password to access certain web pages it does not mean that that pages are secured. The difference between secure and unsecure connection depends on what kind Hypertext Transfer Protocol is used.
There are HTTP and HTTPS transfer protocols. If web site use https transfer protocol it means that data, which is transferred between web server and client browser is encrypted.
If http protocol is used, it means that data is not encrypted and can be eavesdropped. However, you can use unsecure HTTP protocol with login and password for such web sites as message boards, social sites etc. Facebook.com, twitter.com and many others web site use HTTP. They have some kind of protection that is enough for them.
If you are not a bank, you can use HTTP protocol with login and password. You even can use unsecure HTTP for business site. For example, you may display your products or services on unsecure page, but when user needs to enter payment he or she is redirected to secured page. My website uses HTTP protocol. It is not secured, but I use PayPal secured page to accept payment.
Hosting company I use and recomend!
1. Fatcow.com I use it for www.configure-all.com, www.hardstuffez.com and www.healthstairs.com
40% off at FatCow!
Affiliate Disclosure: I may get comission, when you purchase products or services through links on my website.
Please rate the tutorial
Learn SQL Programming By Examples [Kindle Edition]2.99
Learn PHP Programming by Examples [Kindle Edition] $2.99
Learn Visual Basic 6.0 [Kindle Edition] $1.99
How to Build Your Own Web Site from Scratch [Kindle Edition] $1.49
New-trip.com website source code
| Comments | |
|---|---|
- Home
- php_user_authentication
- Batch Files
- Environment Variables
- Delete Trojan horse
- Java Properties
- Form Validation
- Display Image PHP
- Upload File PHP
- phpMyAdmin
- Domain Name
- Name Servers
- CPanel: Mail
- CPanel: MySQL
- CPanel: File Manager
- User_Auth. Demo
- Affordable Hosting
- Hosting Expenses
- Modeless Popup
- Virtual Server
- Read Screen Resolution
- 301 Redirect
- PHP + Oracle 1
- PHP + Oracle 2
- Hosting Tips
- Monitor Site
- Create Gallery
- Authentication Script
- Display from file
- CSS Fixed Layout
- CSS Float Layout
- CSS Tables
- Loading Speed
- Set Shopping Cart
- My Best CSS Layout
- Using Twitter
- SEO tips
- Database Design
- Password Keeper
- MySQL and Excel
- Learn MySQL
- Learn SQL
- Learn PHP
- Learn C++
- Learn Java
- Learn Visual Basic
- Site map
- Registration
Web Programming and Design Tips