PHP-Login-master
所属分类:WEB开发
开发工具:PHP
文件大小:294KB
下载次数:1
上传日期:2018-04-13 06:17:24
上 传 者:
hassan agh
说明: php login master scripte free
文件列表:
css (0, 2018-03-13)
css\bootstrap.css (119912, 2017-04-19)
css\main.css (1085, 2017-04-19)
index.php (696, 2017-04-19)
login (0, 2018-03-13)
login\checklogin.php (1347, 2017-04-19)
login\config.php (2082, 2017-04-19)
login\createuser.php (2381, 2017-04-19)
login\dbconf.php (474, 2017-04-19)
login\globalcon.php (235, 2017-04-19)
login\images (0, 2018-03-13)
login\images\ajax-loader.gif (1569, 2017-04-19)
login\images\screenshot-small.jpg (85888, 2017-04-19)
login\images\screenshot.png (163849, 2017-04-19)
login\includes (0, 2018-03-13)
login\includes\dbconn.php (844, 2017-04-19)
login\includes\functions.php (1860, 2017-04-19)
login\includes\globalconf.php (550, 2017-04-19)
login\includes\loginform.php (5997, 2017-04-19)
login\includes\mailsender.php (3051, 2017-04-19)
login\includes\mysqlerrors.php (646, 2017-04-19)
login\includes\newuserform.php (951, 2017-04-19)
login\includes\respobj.php (210, 2017-04-19)
login\includes\selectemail.php (591, 2017-04-19)
login\includes\verify.php (709, 2017-04-19)
login\js (0, 2018-03-13)
login\js\bootstrap.js (58458, 2017-04-19)
login\js\jquery-2.2.4.min.js (85578, 2017-04-19)
login\js\login.coffee (806, 2017-04-19)
login\js\login.js (1512, 2017-04-19)
login\js\signup.js (1242, 2017-04-19)
login\js\signup.min.js (782, 2017-04-19)
login\loginheader.php (152, 2017-04-19)
login\logout.php (89, 2017-04-19)
login\main_login.php (1604, 2017-04-19)
login\scripts (0, 2018-03-13)
login\scripts\PHPMailer (0, 2017-04-19)
login\signup.php (2035, 2017-04-19)
... ...
PHP-Login
=========
A simple, secure login and signup system with PHP, MySQL and jQuery (AJAX) using Bootstrap 3 for the form design as well as PHP-Mailer for user account verification and confirmation
![Login Page Screenshot](https://raw.githubusercontent.com/fethica/PHP-Login/master/login/images/screenshot.png)
## Installation
### Clone the Repository (recursively to include PHP-Mailer submodule)
$ git clone --recursive https://github.com/fethica/PHP-Login.git
### Creating the MySQL Database
Create database "login" and create tables "members" and "loginAttempts" :
```sql
CREATE TABLE `members` (
`id` char(23) NOT NULL,
`username` varchar(65) NOT NULL DEFAULT '',
`password` varchar(65) NOT NULL DEFAULT '',
`email` varchar(65) NOT NULL,
`verified` tinyint(1) NOT NULL DEFAULT '0',
`mod_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `username_UNIQUE` (`username`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `email_UNIQUE` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `loginAttempts` (
`IP` varchar(20) NOT NULL,
`Attempts` int(11) NOT NULL,
`LastLogin` datetime NOT NULL,
`Username` varchar(65) DEFAULT NULL,
`ID` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
### Setup the `login/dbconf.php` file
```php
Read code comments for a description of each variable
```php
'.$signin_url.'';
//IGNORE CODE BELOW THIS
```
### Place this code (from `index.php`) at the head of each page :
> *** **Important** *** Checks to see if username $_SESSION variable is set. If not set, redirects to login page.
```php
```
### Check the Username and the Password using jQuery (Ajax) :
If the user has the right username and password, then the `checklogin.php` will send 'true', register the username and the password in a session, and redirect to `index.php`.
If the username and/or the password are wrong the `checklogin.php` will send "Wrong Username or Password".
### Signup/Login Workflow:
> 1) Create new user using `signup.php` form
> (note: validation occurs both client and server side)
>
Validation requires:
> - Passwords to match and be at least 4 characters
> - Valid email address
> - Unique username
> 2) Password gets hashed and new GUID is generated for User ID
> 3) User gets added to database as unverified
> 4) Email is sent to user email (or $admin_email if set) with verification link
> 5) User (or admin) clicks verification link which sends them to `verifyuser.php` and verifies user in the database
> 6) Verified user may now log in
近期下载者:
相关文件:
收藏者: