Complete advanced login member system – PHP tutorial

Written by Gertjan on January 11th, 2008

In this advanced tutorial i will teach you the steps required to create a custom build login/member system with PHP.

The system itself ofcourse has alot of room for improvements, also, it’s very easily expandable, i’ve chosen to work in a modular way, so that if you change something you only have to change it in 1 file. I’ve done this by using functions, this script is a good example of the real power of PHP.

Features:

  • Registration
  • Lost password
  • Various checks on passwords and usernames
  • users can change their password
  • Passwords are stored in a database with a seed added to it and they have sha1 encryption
  • Easy to adjust & use

Requirements:

  • Mysql database
  • a php & mysql enabled host
  • php mail() enabled host
  • ftp access to your website

Overview

Steps:

  1. Creating the mysql table
  2. Creating a db_connect.inc.php file
  3. Creating the header.php file
  4. Creating the footer.php file
  5. Creating the index.php file
  6. Creating the login.php file
  7. Creating the logout.php file
  8. Creating a function.inc.php file
  9. Creating the mail.functions.inc.php file
  10. Creating the display.functions.inc.php file
  11. Creating the login.functions.inc.php file
  12. Creating the user.functions.inc.php file
  13. Creating the validation.functions.inc.php file
  14. Creating the lostpassword.php file
  15. Creating the changepassword.php file
  16. Creating the register.php file
  17. Creating the activate.php file

Step 1: Creating the mysql table

For this tutorials i presume you already know how to add tables to your database.

Table login (SQL code):

1
2
3
4
5
6
7
8
9
10
CREATE TABLE  `login` (
  `loginid` int(10) unsigned NOT NULL auto_increment,
  `username` varchar(30) NOT NULL,
  `password` varchar(50) NOT NULL,
  `email` varchar(255) NOT NULL,
  `actcode` varchar(45) NOT NULL,
  `disabled` tinyint(1) NOT NULL default '0',
  `activated` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`loginid`)
);

Now let us add the administrator account:

  • username: admin
  • password: yourpasswordhere

** Change the text yourpassword here with the desired password.

** Change the text youremailhere with your email adress.

SQL query:

1
insert into login (username,password,email,activated) value ('admin',sha1(concat('yourpasswordhere','0dAfghRqSTgx')),'youremailhere','1');

The table is now ready, and the administrator account has been added. let us move on to step 2.

Step 2: Creating a db_connect.inc.php file

This file will be used to manage the connection to the database.

File db_connect.inc.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
// Database settings
// database hostname or IP. default:localhost
// localhost will be correct for 99% of times
define("HOST", "localhost");
// Database user
define("DBUSER", "dbuser");
// Database password
define("PASS", "dbpass");
// Database name
define("DB", "dbname");
 
############## Make the mysql connection ###########
$conn = mysql_connect(HOST, DBUSER, PASS) or  die('Could not connect !<br />Please contact the site\'s administrator.');
 
$db = mysql_select_db(DB) or  die('Could not connect to database !<br />Please contact the site\'s administrator.');
 
?>

Let me explain:

  • HOST: this is the location for the database server it can be a hostname or an ip adress. it is usualy localhost.
  • DBUSER: this is the database user account used to access the database.
  • PASS: this is the password for the database user account.
  • DB: this is the name of the database used.

Step 3: Creating the header.php file

File header.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
error_reporting(0); // we don't want to see errors on screen
// Start a session
session_start();
require_once ('db_connect.inc.php'); // include the database connection
require_once ("functions.inc.php"); // include all the functions
$seed="0dAfghRqSTgx"; // the seed for the passwords
$domain =  "ineedtutorials.com"; // the domain name without http://www.
 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Complete Member Login / System tutorial - <?php echo $domain; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>

Step 4: Creating the footer.php file

The footer file is included at the bottom of every page, it looks like this:

1
2
3
4
<hr>
<div id='footer'>Copyright 2007-2008 &copy; <?php echo $domain; ?></div>
</body>
</html>

Step 5: Creating the index.php file

In this step we will create the homepage of the website, we’ll keep it very basic, only the login will be displayed.

File index.php:

1
2
3
4
5
6
7
8
9
<?php 
 
 require_once "header.php"; 
 //content
 include "login.php";
 // more content
 require_once "footer.php";
 
?>

Step 6: Creating the login.php file

In this step we will make the actual login page, because we want to keep it readable we create some custom build functions that will handle the actual login. So basicly all this page will do is call the functions checkLogin(), show_loginform() and isLoggedIn()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
if (!isLoggedIn())
{
    // user is not logged in.
    if (isset($_POST['cmdlogin']))
    {
        // retrieve the username and password sent from login form & check the login.
        if (checkLogin($_POST['username'], $_POST['password']))
        {
            show_userbox();
        } else
        {
            echo "Incorrect Login information !";
            show_loginform();
        }
    } else
    {
        // User is not logged in and has not pressed the login button
        // so we show him the loginform
        show_loginform();
    }
 
} else
{
    // The user is already loggedin, so we show the userbox.
    show_userbox();
}
?>

Step 7: Creating the logout.php file

The logout file will destroy the session and it’s stored information. Afterwards it will redirect the user to the homepage.

File logout.php:

1
2
3
4
5
6
7
8
9
10
11
12
<?php 
session_start();
if( session_unregister('loginid') == true && session_unregister('username')==true ) {
    session_destroy();
	header('Location: index.php');
  } else {
   unset($_SESSION['loginid']);
   unset($_SESSION['username']);
   session_destroy();
   header('Location: index.php');
}
?>

Step 8: Creating the function.inc.php file

Now we will create a file that will store all our functions, by including this file all our functions will be accessable.
It will help keep track of your functions.

File functions.inc.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
 
require_once("mail.functions.inc.php");
require_once("user.functions.inc.php");
require_once("display.functions.inc.php");
require_once("login.functions.inc.php");
require_once("validation.functions.inc.php");
 
 
function generate_code($length = 10)
{
 
    if ($length <= 0)
    {
        return false;
    }
 
    $code = "";
    $chars = "abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789";
    srand((double)microtime() * 1000000);
    for ($i = 0; $i < $length; $i++)
    {
        $code = $code . substr($chars, rand() % strlen($chars), 1);
    }
    return $code;
 
}
 
?>

Step 9: Creating the mail.functions.inc.php file

This file will contain all functions that we use to send emails.

File mail.functions.inc.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
 
##### Mail functions #####

function sendLostPasswordEmail($username, $email, $newpassword)
{
 
    global $domain;
    $message = "
You have requested a new password on http://www.$domain/,
 
Your new password information:
 
username:  $username
password:  $newpassword
 
 
Regards
$domain Administration
";
 
    if (sendMail($email, "Your password has been reset.", $message, "no-reply@$domain"))
    {
        return true;
    } else
    {
        return false;
    }
 
 
}
 
function sendMail($to, $subject, $message, $from)
{
 
 
    $from_header = "From: $from";
 
    if (mail($to, $subject, $message, $from_header))
    {
        return true;
    } else
    {
        return false;
    }
    return false;
}
 
function sendActivationEmail($username, $password, $uid, $email, $actcode)
{
    global $domain;
    $link = "http://www.$domain/activate.php?uid=$uid&actcode=$actcode";
    $message = "
Thank you for registering on http://www.$domain/,
 
Your account information:
 
username:  $username
password:  $password
 
Please click the link below to activate your account.
 
$link
 
Regards
$domain Administration
";
 
    if (sendMail($email, "Please activate your account.", $message, "no-reply@$domain"))
    {
        return true;
    } else
    {
        return false;
    }
}
 
?>

Step 10: Creating the display.functions.inc.php file

This file will contain all functions that display a form or a userbox on the page.

For example: It contains the loginform, the HTML code for the userbox, the lostpassword form, …

file: display.functions.inc.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
 
#### Display Functions ####

function show_userbox()
{
    // retrieve the session information
    $u = $_SESSION['username'];
    $uid = $_SESSION['loginid'];
    // display the user box
    echo "<div id='userbox'>
			Welcome $u
			<ul>
				<li><a href='./changepassword.php'>Change Password</a></li>
				<li><a href='./logout.php'>Logout</a></li>
			</ul>
		 </div>";
}
 
function show_changepassword_form(){
 
echo '<form action="./changepassword.php" method="post"> 
  <fieldset> 
  <legend>Change Password</legend> 
  <input type="hidden" value="'.$_SESSION['username'].'" name="username"> 
  <dl> 
    <dt> 
      <label for="oldpassword">Current Password:</label> 
    </dt> 
    <dd> 
      <input name="oldpassword" type="password" id="oldpassword" maxlength="15"> 
    </dd> 
  </dl> 
  <dl> 
    <dt> 
      <label for="password">New Password:</label> 
    </dt> 
    <dd> 
      <input name="password" type="password" id="password" maxlength="15"> 
    </dd> 
  </dl> 
  <dl> 
    <dt> 
      <label for="password2">Re-type new password:</label> 
    </dt> 
    <dd> 
      <input name="password2" type="password" id="password2" maxlength="15"> 
    </dd> 
  </dl> 
  <p> 
    <input name="reset" type="reset" value="Reset"> 
    <input name="change" type="submit" value="Reset Password"> 
  </p> 
  </fieldset> 
</form>
';
}
 
function show_loginform($disabled = false)
{
 
    echo '<form name="login-form" id="login-form" method="post" action="./index.php"> 
  <fieldset> 
  <legend>Please login</legend> 
  <dl> 
    <dt><label title="Username">Username: </label></dt> 
    <dd><input tabindex="1" accesskey="u" name="username" type="text" maxlength="30" id="username" /></dd> 
  </dl> 
  <dl> 
    <dt><label title="Password">Password: </label></dt> 
    <dd><input tabindex="2" accesskey="p" name="password" type="password" maxlength="15" id="password" /></dd> 
  </dl> 
  <ul> 
    <li><a href="./register.php" title="Register">Register</a></li> 
    <li><a href="./lostpassword.php" title="Lost Password">Lost password?</a></li> 
  </ul> 
  <p><input tabindex="3" accesskey="l" type="submit" name="cmdlogin" value="Login" ';
    if ($disabled == true)
    {
        echo 'disabled="disabled"';
    }
    echo ' /></p></fieldset></form>';
 
 
}
 
function show_lostpassword_form(){
 
	echo '<form action="./lostpassword.php" method="post"> 
	<fieldset><legend>Reset Password</legend>
  <dl> 
    <dt><label for="username">Username:</label></dt> 
    <dd><input name="username" type="text" id="username" maxlength="30">
    </dd> 
  </dl> 
   <dl> 
    <dt><label for="email">email:</label></dt> 
    <dd><input name="email" type="text" id="email" maxlength="255">
    </dd> 
  </dl> 
  <p> 
    <input name="reset" type="reset" value="Reset"> 
    <input name="lostpass" type="submit" value="Reset Password"> 
  </p> 
  </fieldset>
</form>';
 
}
 
function show_registration_form(){
 
	echo '<form action="./register.php" method="post"> 
	<fieldset><legend>Register</legend>
  <dl> 
    <dt><label for="username">Username:</label></dt> 
    <dd><input name="username" type="text" id="username" maxlength="30">
    </dd> 
  </dl> 
  <dl> 
    <dt><label for="password">Password:</label></dt> 
    <dd><input name="password" type="password" id="password" maxlength="15">
    </dd> 
  </dl> 
  <dl> 
    <dt><label for="password2">Re-type password:</label></dt> 
    <dd><input name="password2" type="password" id="password2" maxlength="15">
    </dd> 
  </dl> 
  <dl> 
    <dt><label for="email">email:</label></dt> 
    <dd><input name="email" type="text" id="email" maxlength="255">
    </dd> 
  </dl> 
  <p> 
    <input name="reset" type="reset" value="Reset"> 
    <input name="register" type="submit" value="Register"> 
  </p> 
  </fieldset>
</form>';
 
}
?>

Step 11: Creating the login.functions.inc.php file

This file will contain the login functions

file: login.functions.inc.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
 
#### Login Functions #####

 
function isLoggedIn()
{
 
    if (session_is_registered('loginid') && session_is_registered('username'))
    {
        return true; // the user is loged in
    } else
    {
        return false; // not logged in
    }
 
    return false;
 
}
 
function checkLogin($u, $p)
{
global $seed; // global because $seed is declared in the header.php file
 
    if (!valid_username($u) || !valid_password($p) || !user_exists($u))
    {
        return false; // the name was not valid, or the password, or the username did not exist
    }
 
    //Now let us look for the user in the database.
    $query = sprintf("
		SELECT loginid 
		FROM login 
		WHERE 
		username = '%s' AND password = '%s' 
		AND disabled = 0 AND activated = 1 
		LIMIT 1;", mysql_real_escape_string($u), mysql_real_escape_string(sha1($p . $seed)));
    $result = mysql_query($query);
    // If the database returns a 0 as result we know the login information is incorrect.
    // If the database returns a 1 as result we know  the login was correct and we proceed.
    // If the database returns a result > 1 there are multple users
    // with the same username and password, so the login will fail.
    if (mysql_num_rows($result) != 1)
    {
        return false;
    } else
    {
        // Login was successfull
        $row = mysql_fetch_array($result);
        // Save the user ID for use later
        $_SESSION['loginid'] = $row['loginid'];
        // Save the username for use later
        $_SESSION['username'] = $u;
        // Now we show the userbox
        return true;
    }
    return false;
}
 
?>

Step 12: Creating the user.functions.inc.php file

This file will contain the user functions

file: user.functions.inc.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
 
##### User Functions #####

function changePassword($username,$currentpassword,$newpassword,$newpassword2){
global $seed;	
	if (!valid_username($username) || !user_exists($username))
    {
        return false;
    }
    if (! valid_password($newpassword) || ($newpassword != $newpassword2)){
 
		return false;
	}
 
	// we get the current password from the database
    $query = sprintf("SELECT password FROM login WHERE username = '%s' LIMIT 1",
        mysql_real_escape_string($username));
 
    $result = mysql_query($query);
	$row= mysql_fetch_row($result);
 
	// compare it with the password the user entered, if they don't match, we return false, he needs to enter the correct password.
	if ($row[0] != sha1($currentpassword.$seed)){
 
		return false;	
	}
 
	// now we update the password in the database
    $query = sprintf("update login set password = '%s' where username = '%s'",
        mysql_real_escape_string(sha1($newpassword.$seed)), mysql_real_escape_string($username));
 
    if (mysql_query($query))
    {
		return true;
	}else {return false;}
	return false;
}
 
 
function user_exists($username)
{
    if (!valid_username($username))
    {
        return false;
    }
 
    $query = sprintf("SELECT loginid FROM login WHERE username = '%s' LIMIT 1",
        mysql_real_escape_string($username));
 
    $result = mysql_query($query);
 
    if (mysql_num_rows($result) > 0)
    {
        return true;
    } else
    {
        return false;
    }
 
    return false;
 
}
 
function activateUser($uid, $actcode)
{
 
    $query = sprintf("select activated from login where loginid = '%s' and actcode = '%s' and activated = 0  limit 1",
        mysql_real_escape_string($uid), mysql_real_escape_string($actcode));
 
    $result = mysql_query($query);
 
    if (mysql_num_rows($result) == 1)
    {
 
        $sql = sprintf("update login set activated = '1'  where loginid = '%s' and actcode = '%s'",
            mysql_real_escape_string($uid), mysql_real_escape_string($actcode));
 
        if (mysql_query($sql))
        {
            return true;
        } else
        {
            return false;
        }
 
    } else
    {
 
        return false;
 
    }
 
}
 
function registerNewUser($username, $password, $password2, $email)
{
 
    global $seed;
 
    if (!valid_username($username) || !valid_password($password) || 
        	!valid_email($email) || $password != $password2 || user_exists($username))
    {
        return false;
    }
 
 
    $code = generate_code(20);
    $sql = sprintf("insert into login (username,password,email,actcode) value ('%s','%s','%s','%s')",
        mysql_real_escape_string($username), mysql_real_escape_string(sha1($password . $seed))
		, mysql_real_escape_string($email), mysql_real_escape_string($code));
 
 
    if (mysql_query($sql))
    {
        $id = mysql_insert_id();
 
        if (sendActivationEmail($username, $password, $id, $email, $code))
        {
 
            return true;
        } else
        {
            return false;
        }
 
    } else
    {
        return false;
    }
    return false;
 
}
 
function lostPassword($username, $email)
{
 
	global $seed;
    if (!valid_username($username) || !user_exists($username) || !valid_email($email))
    {
 
        return false;
    }
 
    $query = sprintf("select loginid from login where username = '%s' and email = '%s' limit 1",
        $username, $email);
 
    $result = mysql_query($query);
 
    if (mysql_num_rows($result) != 1)
    {
 
        return false;
    }
 
 
    $newpass = generate_code(8);
 
    $query = sprintf("update login set password = '%s' where username = '%s'",
        mysql_real_escape_string(sha1($newpass.$seed)), mysql_real_escape_string($username));
 
    if (mysql_query($query))
    {
 
            if (sendLostPasswordEmail($username, $email, $newpass))
        {
            return true;
        } else
        {
            return false;
        }      
 
    } else
    {
        return false;
    }
 
    return false;
 
}
 
?>

Step 13: Creating the validation.functions.inc.php file

This file will contain the validation functions, these function will validate the user input to see if it’s valid and doesn’t contain any illegal characters.

file: validation.functions.inc.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
 
#### Validation functions ####

function valid_email($email)
{
 
    // First, we check that there's one @ symbol, and that the lengths are right
    if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email))
    {
        // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
        return false;
    }
    // Split it into sections to make life easier
    $email_array = explode("@", $email);
    $local_array = explode(".", $email_array[0]);
    for ($i = 0; $i < sizeof($local_array); $i++)
    {
        if (!ereg("^(([A-Za-z0-9!#$%&#038;'*+/=?^_`{|}~-][A-Za-z0-9!#$%&#038;'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$",
            $local_array[$i]))
        {
            return false;
        }
    }
    if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1]))
    { // Check if domain is IP. If not, it should be valid domain name
        $domain_array = explode(".", $email_array[1]);
        if (sizeof($domain_array) < 2)
        {
            return false; // Not enough parts to domain
        }
        for ($i = 0; $i < sizeof($domain_array); $i++)
        {
            if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i]))
            {
                return false;
            }
        }
    }
    return true;
}
 
function valid_username($username, $minlength = 3, $maxlength = 30)
{
 
    $username = trim($username);
 
    if (empty($username))
    {
        return false; // it was empty
    }
    if (strlen($username) > $maxlength)
    {
        return false; // to long
    }
    if (strlen($username) < $minlength)
    {
 
        return false; //toshort
    }
 
    $result = ereg("^[A-Za-z0-9_\-]+$", $username); //only A-Z, a-z and 0-9 are allowed
 
    if ($result)
    {
        return true; // ok no invalid chars
    } else
    {
        return false; //invalid chars found
    }
 
    return false;
 
}
 
function valid_password($pass, $minlength = 6, $maxlength = 15)
{
    $pass = trim($pass);
 
    if (empty($pass))
    {
        return false;
    }
 
    if (strlen($pass) < $minlength)
    {
        return false;
    }
 
    if (strlen($pass) > $maxlength)
    {
        return false;
    }
 
    $result = ereg("^[A-Za-z0-9_\-]+$", $pass);
 
    if ($result)
    {
        return true;
    } else
    {
        return false;
    }
 
    return false;
 
}
 
?>

Step 14: Creating the lostpassword.php file

When the user lost his password he can request a new temporary password. He has to enter his username and his password, if they are correct his password will be reset to a radom generated password and an email will be sent containing this new password, the user can use this password to login and change its password.

file: lostpassword.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
 
require_once "header.php"; 
 
if (isset($_POST['lostpass'])){
 
	if (lostPassword($_POST['username'], $_POST['email'])){
 
		echo "Your password has been reset, an email containing your new password has been sent to your inbox.<br />
		<a href='./index.php'>Click here to return to the homepage.</a>
		";
 
	}else {
 
		echo "Username or email was incorrect !";
		show_lostpassword_form();
 
	}
 
} else {
	//user has not pressed the button
	show_lostpassword_form();	
}
 
 require_once "footer.php";
?>

Step 15: Creating the changepassword.php file

On this page the user can change his password, ofcouse he has to be logged in first. He will also have to enter his old password.

file: changepassword.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
 
require_once "header.php";
 
if (isLoggedIn() == true)
{
 
    if (isset($_POST['change']))
    {
 
        if (changePassword($_POST['username'], $_POST['oldpassword'], $_POST['password'],
            $_POST['password2']))
        {
            echo "Your password has been changed ! <br /> <a href='./index.php'>Return to homepage</a>";
 
        } else
        {
            echo "Password change failed! Please try again.";
            show_changepassword_form();
        }
 
    } else
    {
        show_changepassword_form();
    }
 
} else {
	// user is not loggedin
    show_loginform();
}
 
require_once "footer.php";
 
?>

Step 16: Creating the register.php file

On this page users can create an account.

file: register.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
 
require_once "header.php"; 
 
if (isset($_POST['register'])){
 
	if (registerNewUser($_POST['username'], $_POST['password'], $_POST['password2'], $_POST['email'])){
 
		echo "Thank you for registering, an email has been sent to your inbox, Please activate your account.
		<a href='./index.php'>Click here to login.</a>
		";
 
	}else {
 
		echo "Registration failed! Please try again.";
		show_registration_form();
 
	}
 
} else {
// has not pressed the register button
	show_registration_form();	
}
 
 require_once "footer.php";
?>

Step 17: Creating the activate.php file

On this page users can activate their account.

file: activate.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
 
require_once "header.php";
 
$uid = (int)htmlentities(strip_tags($_GET['uid']));
$actcode = htmlentities(strip_tags($_GET['actcode']));
 
if (activateUser($uid, $actcode) == true)
{
    echo "Thank you for activating your account, You can now login.
		<a href='./index.php'>Click here to login.</a>";
} else
{
    echo "Activation failed! Please try again.";
    echo "If problem presists please contact the webmaster.";
}
 
require_once "footer.php";
?>

Tags: , , , , , , , , , , , ,

Related Posts:

343 Responses to “Complete advanced login member system – PHP tutorial”

  1. Tones Says:

    Can we get this tutorial fixed? I’ce started but well, as you can see its borked up in the posting. I’ve messed with a few user system scripts and wanted to see how this one turned out, and how easily modified it is for something i need one for. Thanks

  2. admin Says:

    Woops, Sorry for the messup

    – fixed –

  3. Ray Says:

    Hey, i have tried this out, and everything seemed fine, but when i try to login with user and password, i just get that i have the wrong login information.. even tried to resetting the password and login with that, but still just getting “Incorrect Login information !”, any suggestions?

  4. Sistema de Login de Usuarios en PHP | HNKweb Says:

    [...] ineedtutorials.com han publicado un interesantísimo tutorial con los pasos a seguir para montar un completo sistema [...]

  5. Daniel Says:

    I couldn’t understand some parts of this article o.us poetry, but I guess I just need to check some more resources regarding this, because it sounds interesting.

  6. SAMMY Says:

    hey welldone for the script,but i think you have some small misktakes for example when you go to register and on register i think you hadt misktake in the file becuase it is register.php thanks very much

  7. SAMMY Says:

    Hey i think you have a mistake in the registersection when you go register its becoming the same page becuase the link is register.php

  8. SAMMY Says:

    someone can replay back with the mistakes thanks

  9. Kary Says:

    Hello
    I published a post of a login member system in ajax

    If someone is interested, this is the url:

    http://www.recursosdelweb.com/como-hacer-un-sistema-de-login-en-ajax-y-php/

    bye!

  10. Alf Jørgen Says:

    This doesent work…

    # Ray Said,

    Hey, i have tried this out, and everything seemed fine, but when i try to login with user and password, i just get that i have the wrong login information.. even tried to resetting the password and login with that, but still just getting “Incorrect Login information !”, any suggestions?

    ____

    I have the same problem! Help me. :)

  11. admin Says:

    I’ve tested out the script and everything seems to work fine here.

    I did found an error in the SQL query that inserts the admin account, it was not activated by default, that’s fixed now.

    If it’s still not working try echo’ing some things in the checklogin function, but again the script should work fine, make sure you have copy/pasted everything correctly.

    * Sorry for my late respons i have exames for the moment.

  12. Jim Says:

    Some people have mentioned that there are errors in the script on this page. Have these errors been corrected yet?

  13. admin Says:

    @ jim

    I’ve re-tested the entire script. works perfectly here. so i guess all errors are gone.

  14. khai Says:

    Can I know at least who are registered after this script is work? When I login as admin I just saw
    Welcome Admin and change password then logout. I wonder how to check member

  15. khai Says:

    Can I know at least who are registered after this script is work? When I login as admin I just saw
    Welcome Admin and change password then logout. I wonder how to check member?

  16. Some Ugly Guy Says:

    Hey I’m new to advance PHP programming, and I don’t know to much sql.
    so what are you supposed to do with the SQL query. do I make a file
    or something?

  17. Complete advanced login member system - PHP tutorial « PHP Net Says:

    [...] entry was written by admin. Bookmark the permalink. Follow any comments here with the RSS feed for this post.Content related [...]

  18. Don Says:

    This script doesnt work at all for me, i have copy n pasted several times and all i get on the index page is a white screen, it seems as if the display functions file isnt working?

  19. scream Says:

    seems as if a bracket like } is missing on your file

  20. james Says:

    Hi
    This does not work for me, I cant
    login, nor can I create a new account.
    The only thing that does seem to work
    is the “lost password” part.
    I noticed a few people have had this
    problem, have you fixed the probem?
    If yes can you please tell me how you
    fixed it.
    Thanks

  21. GotSomeProblems:( Says:

    Hi out there… I need a bit help over here, i even cant see the login formular? Im a little noobie, but plz help me :) .. IT tell me a error in login.php:
    Fatal error: Call to undefined function isloggedin() in C:\xampp\htdocs\MoreAdvanced\login.php on line 10 – and this error in logout.php :
    Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at C:\xampp\htdocs\MoreAdvanced\logout.php:9) in C:\xampp\htdocs\MoreAdvanced\logout.php on line 10

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at C:\xampp\htdocs\MoreAdvanced\logout.php:9) in C:\xampp\htdocs\MoreAdvanced\logout.php on line 10

    Plz help me guys…

  22. darksnoop Says:

    this tutorial is great and every thing works 4 me, but i would like some help i dont want someone register with the same email more then once. I was wondering how can i validate that an email already exist in my database?

  23. Sharpie Says:

    I cannot seem to get the e-mails to work. Whenever I register a name, I see it appears in the DB, but it still says “Registration failed! Please try again.” and doesn’t send the e-mail… so I am assuming that it fails b/c the e-mail is false. any help?

  24. Jethro Says:

    hi, no display at all. i don’t know how to track error and fix em. how to make errors to display?

    @ header.php
    what is the difference of a ‘ and ” ??

    require_once (‘db_connect.inc.php’); // include the database connection
    require_once (“functions.inc.php”); // include all the function

    tnx!

  25. smart Says:

    Use a Select funtion to check for an exit email address

  26. william Says:

    need help creating member oriented website using PHP and xhtml.

  27. Joe Says:

    This is great!

    At first all I could get was a blank screen – it turned out
    I had named a file incorrectly.

    Then it wouldn’t let me register. I tried sniffing out any errors but the
    logic here is pretty flawless.

    Turns out:
    The problem was an ID-10T error. It’s easy to fix just follow the directions heh.

    Thank you,

  28. ICEWATER_MAN Says:

    great example it really helps thank you

  29. XXX Says:

    Hmm sometimes it’ll get some errors there,i wonder why?

  30. Misael Says:

    @ Sharpie

    I got the same error, and then I noticed that the passwords have to be AT LEAST 6 characters long (I was using a 4 character password) once I used one with 6 characters it worked perfectly, so when you create the “login” table and input your info, try using 123456 or something like that for password, same for registering new users. Hopefully it will work for you.

  31. Misael Says:

    @admin

    thanks for the script, it’s a great, great piece of code… I don’t know if the password being 6 characters long is actually a requirement (haven’t analyzed the code yet) but if it is, a note would definetly help newbies like mtyself haha, again thanks! script like this really help us get to new levels of PHP understanding.

  32. Kyle Bernard Says:

    You made a little error on step 14. On the description you say you have to enter in the username and password in order to change your lost password. I know you meant email, because it reflects in the code, but It kinda threw me off lol

  33. Martin Says:

    Very nice tutorial!
    Easy to understand, modify and use!
    Keep em’ coming! :-)

  34. nikee Says:

    hi,
    i try execute this below programme and also i create the database but it
    not work.

    <?php
    // Database settings
    // database hostname or IP. default:localhost
    // localhost will be correct for 99% of times
    define(“HOST”, “localhost”);
    // Database user
    define(“DBUSER”, “md5″);
    // Database password
    define(“PASS”, “logical”);
    // Database name
    define(“DB”, “info”);

    ############## Make the mysql connection ###########
    $conn = mysql_connect(HOST, DBUSER, PASS);
    if (!$conn)
    {
    // the connection failed so quit the script
    die(‘Could not connect !Please contact the site\’s administrator.’);
    }
    $db = mysql_select_db(DB);
    if (!$db)
    {
    // cannot connect to the database so quit the script
    die(‘Could not connect to database !Please contact the site\’s administrator.’);
    }
    ?>

    i try to excute this on to Wamp but it gives me an error.

    ***Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘md5′@’localhost’ (using password: YES) in C:\wamp\www\db_connect.inc.php on line 14
    Could not connect !
    Please contact the site’s administrator.***

    please help me
    nikee

  35. Lars Says:

    I got the problem with the blank index page. My MySql connection is correct but I got a problem with the index.php file I only se a white page and nothing else? can anyone help me?

    Thinks I done:
    I have checkt all the file names and there is no fauæt with those they are all correct.

  36. Lars Says:

    I can se everything now but I now got two new problems :( that I need some help with. First I got the same problem as some of they other users I get the message that the user account is not made even thoe it is. My second problem is that I am having some problems with the login function I can se the user accounts in my database but when I try to login I get the message that I have enter the wrong information even thoe I know that it is the rigt information.

    Hope someone can find the time to help this sad panda. :(

  37. slex Says:

    nikee try this one. open the file db_connect.inc.php, and replace it
    with this codes.

    note* if your running it at local installation dont change the $hostname.
    follow this codes.

    $hostname=”localhost”; // don’t change
    $mysql_login=”root”; // don’t change
    $mysql_password=”"; leave it blank
    $database=”database_name”;

    if (!($db = mysql_connect($hostname, $mysql_login , $mysql_password))){
    die(“Can’t connect to mysql.”);
    }else{
    if (!(mysql_select_db(“$database”,$db))) {
    die(“Can’t connect to db.”);
    }
    }

  38. Desert Says:

    @ Lars

    hey mate, for the blank pages… make sure there are NO additional spaces or characters in your files as this will fault the Session starts… depending on PHP error reporting settings this will either show the error or through in a blank page. Otherwise check the other php settings, especially module settings, might be that some register faulty, causing the php engine to crap out.
    On the user registration.. make sure you register your users with a 6 character password… this will remove the users not showing in the admin login and get the logon working for the users.

    In general, although php error reporting settings should not through the script off, to see if php settings are the problem, make sure your PHP error reporting is set to default…

  39. Txchaser Says:

    I am still new with PHP, have followed this tutorial closely and am running into a problem. I made all pages as it says in tutorial. The db connection settings are correct, put everything on the site. when going to the site it is asking me if I want to save the file or find a program on the internet to open it. What have I done wrong? In one of the other tutorials I followed for a login I had the same problem and found that “try true” had to be in the url, that got the page to load on that tutorial but then the rest of the script was broken. Any help in getting this fixed would be appreciated.

  40. TheCore Says:

    One of the best tuts on the net regarding authentication. I used it as a base for building a very complex register and login application for my project. Most problems i read about here is about missing semicolons “;” i bet :) – or errors in code added that is not part of this tutorial, or errors regarding special contidions on the users servers.

    Well done mate. You saved me for 2 months of reading.

  41. Hardy Says:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/ubiquese/public_html/login/logout.php:1) in /home/ubiquese/public_html/login/logout.php on line 2

    Warning: Cannot modify header information – headers already sent by (output started at /home/ubiquese/public_html/login/logout.php:1) in /home/ubiquese/public_html/login/logout.php on line 5

    Any clues??????

  42. Tomtom Says:

    Hi,
    got the same problem as a 24. Sharpie. How I can Use a Select funtion to check for an exit email address? I use free hosting. That can be a reason why is it not working??? Thx

  43. Hasnat Says:

    hey I have copy and paste the codes! everything seems to me fine but whenever I run the index.php it show me blank screen!

    Also if I want to run login.php it show me error named:Fatal error: Call to undefined function isloggedin() in C:\xampp\htdocs\ad-login\login.php on line 2

    pls help me ASAP!! It’s urgent!!

  44. Hasnat Says:

    dear admin, pls give me a solution! I think a lot of people faced this problem! pls help me about this regard!

  45. Bob Says:

    My Host is using MySQL version 5.0.32

    In user.functions.inc.php, the function registerNewUser($username, $password, $password2, $email) would produce a MySQL error when the $sql query was run. I had to made the following changes where the commented out portion was the original script that didn’t work for me. Since I couldn’t figure out how to fix it, I replaced it with something that works and that I knew would work. Maybe it will fix some of the other peoples problems also.
    ============
    code
    ============
    /* original $sql statement that didn’t work for me

    $sql = sprintf(“insert into login (username,password,email,actcode,0,0) value (‘%s’,'%s’,'%s’,'%s’,'%u’,'%u’)”,
    mysql_real_escape_string($username), mysql_real_escape_string(sha1($password . $seed))
    , mysql_real_escape_string($email), mysql_real_escape_string($code));
    */

    // New Code that did work for me – retaining as much of the original logic as I could figure out
    // how to do.
    //
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string(sha1($password . $seed));
    $email = mysql_real_escape_string($email);
    $actcode = mysql_real_escape_string($code);
    $sql = “INSERT INTO login SET
    username = ‘$username’,
    password = ‘$password’,
    email = ‘$email’,
    actcode = ‘$actcode’”;

    After making the above change, the registration of a new user worked for me, although I discovered that I had to change the value of the $domain to the actual domain name I was running it from in order for the activation link in the email to work.

    I also had to change the host from ‘localhost’ to my actual host name as ‘localhost’ didn’t work for my account.

    The only other part I was confused on was the script to add the admin account. It seemed easier to just create the admin account with the program once it was working!

    It appears to be a good system and I expect to learn quite a bit by studying more on how it was constructed. Thanks for your efforts to educate us!

  46. ORiOn Says:

    I have exactly the same error as @Hasnat…
    Plz admin help us…
    :(

    @hasnat, if you have the answer can you tell me plz :(

    tanks,
    ORiOn

  47. Lars Says:

    Can someone that has this working send me the files in a zip file? I still got the problem with the message that the user account is not made even thoe it is. My second problem is that I am having some problems with the login function I can se the user accounts in my database but when I try to login I get the message that I have enter the wrong information even thoe I know that it is the rigt information.

  48. Des The Worlds Worst Poker Player! Says:

    @ADMIN
    Yo !
    Great script :)

    Just wondering what kind of licience or rights we have to it.

    Des

  49. Fiyjaak Says:

    This is great

  50. Superior Says:

    script is not working for me. it is showing blank page on index.php and
    Fatal error: Call to undefined function: isloggedin()
    in /XXX/XXX/public_html/XXX/member/login.php on line 2
    in login.php file.

  51. diddzi Says:

    i had the same problems,do exactly what it says and copy it,there is a minimum limit on the password to 6 so make sure its more than six characters long.Also ont eh db_connect form change the domain name to yours for the validation to work.

  52. bGr Says:

    Hi,
    i found mistake in header.php file..

    find this :

    require_once (“functions.inc.php”);

    and replace with :

    require_once (“function.inc.php”); // without S in functions, we haven’t file functions.inc.php

    sorry for my english..

  53. Lane Says:

    well, all i really want to know is…
    on my site i have a members area and a n on members are, all i mwant to kno reallyu is how can i say on this sertain page, you must be a member and logged in to see this page?

  54. Kerry Says:

    Can register just fine and see it in MySQL database but when I login in it gives
    me an error of incorrect information. Any suggestions of where to look to fix this?
    Also I’m not receiving anything in my email when I try to reset password.

  55. Lane Says:

    its a nice tutorial, i was wondering if you can ass some sections in on it. like a section so that when you log into your ccount you can make a profile as a member about location age intrests and maybe be able to paist a pic of yourself at the top like the social networks on your scripts and let any user be able to see the profiles by clikcing one link to all gathered members profiles.. also add a section to that if a non member or a member not signed into the system will regect it to a givin page that needs you to be logged onto the account

  56. Lane Says:

    same problem as kerry, i resset my pw and idk the pw and no email was sent to my main XD

  57. MTF95 Says:

    All pages are just blank :S

  58. JD Says:

    I hate to ask what seems like a very stupid question but where do I put my website information so that it will be displayed once logged in? I am new to this and any help would be appreciated.

  59. Over 50 of The Best Tutorials from 2008 (so far) « NI-Limits Blog Says:

    [...] Advanced Log-In Member System [...]

  60. mit Says:

    Could not connect !
    Please contact the site’s administrator.

    when i try to log in to the system by local host i get this error!!! can any one help me?

  61. Muffy Says:

    Excellent article. Very impressed. I had never used php or mysql before and this has saved me hours of work developing a member log-in web site. For help try and Google ‘php tutorial’, or ‘html tutorial’ for the equally excellent w3schools site.

  62. dhfola Says:

    Just an blank screen =[ :( pllllzzzzzz can someone help if u want i will
    send u all my files for that i get the same error when i go 2 login.php
    email me at admin@dhfolam.co.cc plz help or u can use my daily email vmkrightpoint@gmail.com
    thx kennn

  63. styljola Says:

    Hi,

    Creating the mysql table – How name creation table?

  64. dhfola Says:

    i think i know what u mean if u got phpmyadmin go to the database u want the tables to be in then u go to import choose the sql file .sql u can copy the tables

    CREATE TABLE `login` (
    `loginid` int(10) unsigned NOT NULL auto_increment,
    `username` varchar(30) NOT NULL,
    `password` varchar(50) NOT NULL,
    `email` varchar(255) NOT NULL,
    `actcode` varchar(45) NOT NULL,
    `disabled` tinyint(1) NOT NULL default ’0′,
    `activated` tinyint(1) NOT NULL default ’0′,
    PRIMARY KEY (`loginid`)
    );

    into notepad then u put .sql at the end of the file type
    so its tables.sql then u click ok or upload or import then it should work
    then u do the same for the admin but your inserting it into that why it got

    insert into login (username,password,email,activated) value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),’youremailhere’,’1′);

    i hope that is what u mean…

  65. styljola Says:

    Yes I do it but I have info:
    Could not connect !
    Please contact the site’s administrator.

  66. styljola Says:

    In my serwer
    register_globals is off

    For this script it must be on?

  67. magicbydave Says:

    OS window server 2003 -iis 6

    PHP and mysql installed and working properly.

    almost everything works for me. I can load the pages and the admin login works but when I register a new user it says registration failed. It does create the user in the DB but no email goes out because I do not have a php mail() enabled host will this cause this to happen or is it something else?

    if any one can explain to me how to make my server a php mail() enabled host it would help greatly.

    thanks

  68. liam Says:

    how do you put the login box on your homepage?

  69. dhfola Says:

    i did some looking threw the code on index.php there is

    include “login.php”;

  70. Alex Says:

    Great script! Thank you for sharing this! It’s easy to understand and modify.
    Thanks again!

  71. Nick Says:

    I am getting the following error. I have enter the database details in db_connect.inc.php

    Could not connect !
    Please contact the site’s administrator.

    Any advice?

  72. magicbydave Says:

    I am having the same problem as Sharpie.

    I cannot seem to get the e-mails to work. Whenever I register a name, I see it appears in the DB, but it still says “Registration failed! Please try again.” and doesn’t send the e-mail… so I am assuming that it fails b/c the e-mail is false. any help?

  73. CHRIS Says:

    I simply cannot get this to work, just a blank index page, but it does make a good connection to the database.
    I am a newbie to php but am trying very hard to see if I can find a problem before requesting help from you good folk out there.
    One question though, my web site host has told me, they do not allow register_globals to be set to ON but do support phpMail…

    With register_globals set to OFF is it still possible for this program to work. ?? In item 66 it appears to suggest register_globals must be set to ON.

    Can anyone help with a Zipped collection of all the different pages that have been corrected and known to be good working pages..
    Your assistance will be greatly appreciated and I might have some hair left on my head afterall.

  74. Sohn Says:

    It’s doesn’t work! I try many time. I can’t log in as admin and can’t do anythings! index.php show me the form for log in but all function look doesn’t work. Plz help!

  75. dhfola Says:

    Hey dhfola again i found why it coming with a blank screen, i think
    i’m no php expert or anything i havn’t tried this yet but i will after
    ok
    go to your header file (header.php)
    go to line 2:
    error_reporting(0); // we don’t want to see errors on screen
    as you read it says we don’t want to see any errors and when i was
    deleting files for it because i was going to find another tutorial but
    i remove the main files that header includes and it came up with missing files
    error so this might work find out your errors so you can fix them ou
    can search on google for help for that error byes
    ken

  76. Dhfola Says:

    Yay it works now! i’m creating a website where users can write tutorial and
    stuff like codeproject

  77. magicbydave Says:

    I found an error in the function sendMail() there is a extra return false; at the end of the function. it will cause Whenever you register a name, you see it appears in the DB, but it still says “Registration failed! Please try again.” because the sendmail function is always false.

  78. blackeagle Says:

    haveing problem with the activation but everything else works fine although i can activate via mysql

    thanks for this great tute btw

  79. blackeagle Says:

    sorry bout last post there was no probs with the acivate.php
    it was the mail fuction not pointing to the folder that activate.php file was in
    was in. so all sorted now works like a charm.

    now i just need to work out how to css it.(lol)

  80. Prabath Says:

    I have found few errors/ mistakes here

    1. Title of the section for functions.inc.php was written without a “s” at
    the end of “function” so some one may take the php file name from the title
    as “function.inc.php”. this is incorrect. so correct file name is
    “functions.inc.php”

    2. when you insert “admin” record at first using sql command give at least
    6 letter password, otherwise you will not get into admin login page

    After correcting these, I hope you will be able to login to the system

  81. Robert Says:

    What a wonderful tutorial! Very clear, helpful, and useful! I’m able to greatly customize it the way that it is needed, including placing the login and register script anywhere! :)

    For those that want to know how to edit the custom error/success messages, locate them via login.php, logout.php, ect. Find something like:

    echo “Sorry, but you are unable to login.”;

    And change the ” to ‘s.

    echo ‘Sorry, but you are unable to login.’;

    Then you can add any html element between the ‘…’!

  82. George Says:

    hello
    i did so but it semmed not to show anything on the pages
    in login.php it was told “Call to undefined function isLoggedIn()”
    i dont know if this work anywhere
    need help
    thanks
    i use php latest version 5.5

  83. swathi Says:

    hello,

    when i entered username and password it gives an error like “Incorrect Login information !”.
    and also when i am getting registerd it gives an message as “Registration failed! Please try again.”

    please help me.

    thanq

  84. cf329rn Says:

    hey ermm just a bit of questions y’know makin the admin acc… well what do i save that as?

  85. spotless Says:

    I am running MySQL ver. 5.0.45 and get to user.functions.inc.php and it stops. I get a blank screen when I run index.php. I put echo commands as a trace and find that it stops in user.functions.inc.php.

    Any ideas?

  86. dhfola Says:

    Remove error_reporting(0); from header.php then the errors will display,
    fix them then it works for me XD

  87. Spotless Says:

    I have tried removing error_reporting(0). I even put an echo in to trace the error. It gets stuck at user.functions.inc.php. There is no error message. I just get a blank screen.

  88. HELP!!! Says:

    I need help. no more blank page, but i get this
    ?php require_once(“mail.functions.inc.php”); require_once(“user.functions.inc.php”); require_once(“display.functions.inc.php”); require_once(“login.functions.inc.php”); require_once(“validation.functions.inc.php”); function generate_code($length = 10) { if ($length <= 0) { return false; } $code = “”; $chars = “abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789″; srand((double)microtime() * 1000000); for ($i = 0; $i

  89. Jerry Says:

    ?php require_once(“mail.functions.inc.php”); require_once(“user.functions.inc.php”); require_once(“display.functions.inc.php”); require_once(“login.functions.inc.php”); require_once(“validation.functions.inc.php”); function generate_code($length = 10) { if ($length <= 0) { return false; } $code = “”; $chars = “abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789″; srand((double)microtime() * 1000000); for ($i = 0; $i

  90. sujan das Says:

    I got the problem with the blank index page. My MySql connection is correct but I got a problem with the index.php file I only se a white page and nothing else? can anyone help me?

    Thinks I done:
    I have checkt all the file names and there is no fauæt with those they are all correct.

  91. sujan das Says:

    I got the problem with the blank index page. My MySql connection is correct but I got a problem with the index.php file I only se a white page and nothing else? can anyone help me?

    Thinks I done:
    I have checkt all the file names and there is no fauæt with those they are all correct.

    please hep me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  92. fabian Says:

    I got a problem with the activation code, I get the error 404 message if I click on the activation link in the email.

  93. Mattia Says:

    The login form doesn’t works. That’s because it can’t transform the md5 password format???

  94. fabian Says:

    insert into login ( username,password,email,activated) value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),’youremailhere’,’1′);
    i don’t know where i got to place this code… in a mysql table or the first table?

  95. Mattia Says:

    I solved my problems, it was just a my little mistake done in login.functions.ic.php! :D
    The script works fine. Good tut, now i’m gonna study it all for expand and opttimize it!

  96. Jim Says:

    Blank screens:

    Change this:

    echo ‘ // ” in stead of ‘, also below at the ‘a href’ commands
    Welcome $u

    Change Password
    Logout

    ‘;

  97. manu Says:

    insert into login (username,password,email,activated) value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),’youremailhere’,’1′);

    Could not connect !
    Please contact the site’s administrator.

    DONDE SE PONE ..NO ME PUEDO CONECTAR A LA BASE DE DATOS.
    MEDA ESTE ERROR.

    ME LO PUEDEN ALCLAR UN POCO MEJOR PORFAVOR.

    mafey_fc@hotmail.com.

  98. h Says:

    @manu
    there’s an error… it is not activated it is actcode… Please make sure that you are connected. Which front-end are you using?

  99. manu Says:

    insert into login (username,password,email,activated) value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),’youremailhere’,’1′);

    :’( donde pongo esto me trae loco
    ayuda por favor. gracias

  100. manu Says:

    HELP PLISS

    Could not connect !
    Please contact the site’s administrator.

  101. Kai Says:

    This system is working perfect, if you get blank screens change header.php.

    It wants to include functions.inc.php, this needs to be changed to function.inc.php without the “s”.

    Thanx for the tut.

  102. manu Says:

    This system is working perfect, if you get blank screens change header.php.

    It wants to include functions.inc.php, this needs to be changed to function.inc.php without the “s”.
    thank you kay
    example pliss heer

  103. manu Says:

    insert into login (username,password,email,activated) value (‘admin’,sha1(concat(‘xxxxxxxxxxx’,’0dAfghRqSTgx’)),’mafey_fc@hottmail.com’,’1′);

    Could not connect !
    Please contact the site’s administrator.

    they can help me, this goes within the data base (you) or where it is put I am not able to connect gives east error me. they prodian to me to put an example. or to put itself in contact with me my post office is, mafey_fc@hotmail.com

    MySQL ha dicho: Documentación
    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”,sha1(concat(XXXXXX)’mafey_fc@hotmail.com’,’1′);

    ‘,’0dAfghRqSTgx’)),’ at line 1

  104. Manu Says:

    Could not connect !
    Please contact the site’s administrator.

    it changes with forms you explain and it continues giving the same error to me, it helps please, mandame an example mail if you are so amiable. or this script php is erroneous

  105. Manu Says:

    Could not connect !
    Please contact the site’s administrator.

    it changes with forms you explain and it continues giving the same error to me, it helps please, mandame an example mail if you are so amiable. or this script php is erroneous

  106. DynamiteN Says:

    hi.
    tried this and it works perfect, but i am working on a site where i want a particular section to be all for admin or VIP and so on .. wa wondering how i can do so that i can have admin and s on … i need to add something to db ? or maybe in php … ? …. relly do need to know it does work great otherwise…

  107. h Says:

    Hi @DynamiteN you can add in the login table… an attribute that saves the kind of user. For example… admin = 1 , user = 2. When you logged in, you evaluate which kind of user it is trying to access. In this way, you can redirect to different pages!
    Happy programming

  108. h Says:

    @manu.. you are not saying the things clear… PLEASE be specific

  109. Manu Says:

    said hello, I

    I get this ruling,
    Could not connect!
    Please contact the site’s administrator.
    where I have to work to put the record in the database.
    and if I can help send a login system completro co redirecion counter sela mail to activate your account, I hope you can help me thank you
    Note: If your services can pay for your work would be a pleasure, and also thank you, to teach people like us who started in this field dificl php.
    thanks again mafey_fc@hotmail.com

  110. h Says:

    @manu which mysql front-end are you using ?

  111. DynamiteN Says:

    @h
    k ..
    but what is it i then would add in the db ,
    i mean ,
    if i add in to the login table something like “levelid” or just “admin” then what is it i shall put in the fields ? .. i use phpmyadmin to acces my db.

    the experince is less then php for me …
    would really appreciate the help ….

    //DynamiteN

  112. h Says:

    @DynamiteN suposse that somebody else is gonna register the vip or admin people right ?
    in that case you’ll have to put something like this

    insert into login (username,password,email,activated, type) value (‘mamma’,sha1(concat(‘mypassword’,’0dAfghRqSTgx’)),’mamma@info.com’,’1′, ’1′);

    In this case you’ll know that 1 is admin, if you register a normal user it will be like this

    insert into login (username,password,email,activated, type) value (‘noob’,sha1(concat(’1234567′,’0dAfghRqSTgx’)),’noob@info.com’,’1′, ’0′);

    In the other hand 0 will be by the others users!

    You can use the same page of registering. You only pass a variable in the link that you know that you are registering normal users or vip. For example http://www.yoursite.com/index.php?register=1

    If it is says 1 it will process the first query but if register=0 it will be the normal registration. Please let me know if you need help!

    cheers~

  113. Sathiya Narayanan Says:

    hi i am new to php and website development.
    CAN U PLEASE HELP ME IN RUNNING THIS CODE IN MY COMPUTER LOCALHOST???????

    i tried but it shows some error and displays Could not connect !
    Please contact the site’s administrator.

  114. h Says:

    @Sathiya Narayanan which server are you running? IIS or Apache?

  115. Sathiya Narayanan Says:

    @h : Apache……..

  116. craig Says:

    its it work

  117. Sathiya Narayanan Says:

    Dude please help…… i am developing a online library system.
    i need this module desperately……… please tel how to run
    this code in apache server(local host).

  118. h Says:

    @Sathiya Narayanan when you say could not connect? You are talking about the db ? please display the errors…

  119. K.Sathiya Narayanan Says:

    “Could not connect !
    Please contact the site’s administrator.” get this error at first page itself

  120. Bob Says:

    Fatal error: Function name must be a string in /home/gamers/public_html/login.php on line 2

    I keep getting that error and the rest of my pages are white but the footer???

    Help please???

  121. Bob Says:

    ?php require_once(“mail.functions.inc.php”); require_once(“user.functions.inc.php”); require_once(“display.functions.inc.php”); require_once(“login.functions.inc.php”); require_once(“validation.functions.inc.php”); function generate_code($length = 10) { if ($length <= 0) { return false; } $code = “”; $chars = “abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789″; srand((double)microtime() * 1000000); for ($i = 0; $i

    I keep getting this on everypage now and still login.php is messed up still.

  122. h Says:

    @Sathiya Narayanan hello, have you checked your config file ??:P

  123. Robert Says:

    Hi,

    I tried and tested your complete member log in script and its very powerful however i have something to add the following:

    1. I want to add firstname, lastname and phone number, i tried to edit the script and add rows in the table but it doesn’t work.

    2. After the activation, it will redirect to a certain site.
    3. When the user activated the account, and when he clisk it for the 2nd time it will redirect to a certain site instead of echoing “you already subscribe”

    Best regards,

    Robert

  124. heliver Says:

    Hi,

    No blank screen but I have this error,
    Parse error: parse error in D:\WWW\Login\user.functions.inc.php on line 73

  125. heliver Says:

    Hi,

    No blank screen but I have this error,
    Parse error: parse error in D:\WWW\Login\user.functions.inc.php on line 73

    71: global $seed;
    72: if (!valid_username($username) || !valid_password($password)
    73: !valid_email($email) || $password != $password2 || 74:user_exists($username))

  126. santhosh Says:

    Hi need php projects to do practice on php. Any site is available to get a free projects….or any one have projects on php , PLEASE send to this mail id: santhosh_247@yahoo.co.in

  127. Cliff Says:

    Hi There
    I have spent hours trying to get this to work, I think by now I’ve lost the plot.

    Can you please help!!

    When you enter your correct username and password press the login button how do I get it to go to a page say welcome.php

    Also how to protect my existing pages.

    Many Thanks
    Cliff

  128. kaise Says:

    Hello,

  129. kaise Says:

    Hello,
    I’m new to webdesign and and also to php and mysql. Can you please advise if this script has a remember me tick box also what kind of password protection does this use?? Not sure if I read anythin on password protection.

    I have a script already that has a 32bit md5() password encryption and also the use of sha1() 40bit encryption to generate a 40 digit hash that is used for the activation code, what this script does not ahve is a cookie to remember me function. ALso not sure if the script works as I have not been able to test it as am not familiar with working with localhost yet. If anyone can help they can contact me on my email kaise@hotmail.co.uk.

    Thank You and any help will be much appreciated.

  130. Christine Says:

    Excellent code :) … I am getting everything to work except I can’t register… it keeps saying registration is failed, but I did get my admin account to work…

    Any ideas?

  131. Christine Says:

    scratch my last post…i got the registration to work, but I actually need to add critera to the registration and I’m not sure how to do it. I added it to the HTML, but when i enter information in when I register, it doesn’t go through to my database (mysql), where else do I need to edit the feilds.

  132. Vivek Says:

    Amazing!! Can’t thank you enough for this, very detailed, very helpful!!

    Cheers!! …Vivek

  133. Omar Says:

    I would love to get this code working correctly. We host our own web server and need this for our clients to login. Looking for a way to protect the clients page using this code. Can anyone help? I got the code somewhat working. Not sure how to protect my clients page so that they need to login to view it. do I place a login code at the top of my client page?

    Omar operez@b-g-s.com

  134. john k Says:

    I am getting this message when i use my browser to go to index page

    Fatal error: Call to undefined function isloggedin() in /home/traffic2/public_html/insane/login.php on line 2

    Any Ideas / Suggestions ???

  135. john k Says:

    never mind lol I see I have to include some files sorry. So far this seems excellent !

  136. wtf Says:

    terrible

  137. iain Says:

    Gertjan, you rock hard! Excellent tut.
    One small amend, line 102 (user.functions.inc.php) is missing the or operator between password and email
    (my text editor picked it up).
    Thanks so much for sharing.

  138. pronek Says:

    HELP – When I wont add admin I have this:
    #1064 – Something is wrong in your syntax next to ‘value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),” in line 1

  139. sjoerd Says:

    Looks like you’re mixing up single quotes (‘) and left/right quotes (` and ’). Just make sure all your quotes are the ordinary single quote (‘) and then try again.

  140. Abraham Says:

    Anyone! Please help me, i need to no how to do a error message to show to the user when they have type wrong in activate form.

  141. Goodwine Says:

    nice, many people is complaining, but I think it is a good tutorial which can be easily fixed, at least this gave me an idea
    thanks :)

  142. AristRofl Says:

    WORKS GREAT!

    But this may just be my problem, where does the script register variables into the SESSION? I’m trying to register another field that I added to the table. “avatar”, I just can’t seem to find it.

  143. erik Says:

    ok im totaly new here bought a site yesterday so..
    and now i want a log in system so ive tried to dos omething etc but now i get this error..

    Please contact the site\’s administrator.’); $db = mysql_select_db(DB) or die(‘Could not connect to database !
    Please contact the site\’s administrator.’); ?>

    could you help me??
    im getting this by selecting the .php file on my site

  144. karl Says:

    yo tengo que hacer el formulario??????

  145. TetrisSmalls Says:

    I must say, Great Tutorial. I can understand why people are getting blank pages after they set up the site. I’ve had the same thing happen to me, but I was able to fix it. When the user clicks view code for the user.functions.inc.php, there is something missing in the registerNewUser function. There needs to be another || after !valid_password($password) on line 101. After adding that or operator (||), your project should work, that’s if you followed the rest of the tutorial how it is supposed to be followed.

  146. Daan Says:

    Its works great, but got an problem…

    When I try to register. I fill in te form and sumbit te register button.

    I get the message: “Registration failed! Please try again.”

    But when I take a look in me database, I see the username password and email I just had enterd in the registration form.

    whats wrong with the code? I just copied the whole code above here. and tested if the code worked correctly.

    Don’t know what to do now.!

  147. zaldy Says:

    Excellent code :) … I am getting everything to work except I can’t register! it keeps saying registration is failed! i been copy all the code above.. what would be wrong? plz email me if you read this i really actually need this to my login system school project! dmokil22@yahoo.com email me plss.

    Any ideas?

  148. MHz Says:

    How to specify another target for lostpassword and the other thing like activation. I am using PHP tables, so I get a url like this: index.php?page=lostpass , how to set the target to ‘index.php?page=lostpass’? Thanks

  149. MHz Says:

    I just found it in ‘display.functions.inc.php’, but when I change the ACTION variable to ‘index.php?page=lostpw’ I get this error: ‘
    Fatal error: Call to undefined function lostpassword() in …/lostpassword.php on line 7′ Can this be solved? Thanks

  150. MHz Says:

    In the mean time I kept searching for a solution and now everything works accept one thing. When I login and click the changepassword link, I get the login form because there is no sessions. Why?

  151. balazscsaba2006 Says:

    Hy all!
    i don’t know how Christine made the registration not to fail, ’cause no matter what i do, i just can’t log in!
    …why???
    please help
    appreciate it

  152. balazscsaba2006 Says:

    pffff…no i managed to get the login to work, i can log in, but the script doesn’t send mail. i deleted the extra “return false” from the sendMail function, but still isn’t sending a mail…i ahve no clue why :)
    please help me!!!

  153. Heeeelp!! Says:

    When I go to my register page nothing appears on the screen! It is just blank. I checked my connect file and everything is correct! Help!!!!????

  154. Heeeelp!! Says:

    Nvm. But now I get
    Fatal error: Call to undefined function isLoggedIn() in C:\Abyss Web Server\htdocs\login\login.php on line 3
    This is on my login.php

  155. MHz Says:

    When I login and click the changepassword link, I get the login form because there is no sessions. Why? I’m using php tables, so I get a url like index.php?action=changepw

  156. cheekylele Says:

    hi firstly what an awesome tutorial thankies!
    im implementing this into my content management system and the register/login process works fantastically – the only problem is that I’m testing locallly and the Activation email never gets sent …
    however, the record does exist in the database and the login is functional once you register the details …
    can you elaborate on Step 9 – Creating the mail.functions.inc.php file:
    how can I get the Activation Email working?
    Thanks!

  157. cheekylele Says:

    omfg …. after reading the four pages of comments and doing a bit of tinkering around I managed to fix my problem … haha
    ignore my question as I fixed it myself … yay!
    but to reiterate … your script was awesome and I learnt SHITLOADS!!!
    muchos gracias amigo! :)

  158. Kevin Says:

    First of all thanks for this awesome tutorial!
    I’ve learned tons by just checking the code :D

    BUT, Everything works, email-system too except when you click the link in the email I get the following error:

    Activation failed! Please try again.If problem presists please contact the webmaster.

    They information is added to the table thought (with activation = 0)

    Thanks in advance :D

  159. Kevin Says:

    Found it.

    In the registerNewUser function the 2 ‘$id’s should be $uid.

  160. MHz Says:

    When I login and click the changepassword link, I get the login form because there is no sessions. Why? I’m using php tables, so I get a url like index.php?action=changepw

  161. Matt Says:

    This would be a much better script when it should be build on the zend framework.

    mysql_ is not developed further anymore and mysqli and pdo are both in the Zend Framework.

  162. Riz Says:

    please tell me z there any error in….
    if (!isLoggedIn())

    bcoz it tels this as a error!!!!

  163. Rysy Says:

    Works fantastic, thank you very much!
    Is there anyway to stop the activation emails ending up in the outlook junk email filter?

  164. Andrew Says:

    There is a major security bug in the change password form… you could just make your own HTML file and change the value of the user name and change anyones password…

  165. Suzzy Says:

    I’m getting that annoying “No input file specified.” message when I try to activate. I’ve done error checking and looked for mistakes in file names but I’m not finding anything. Anyone know what might be causing it?

    I know that the message “No input file specified.” comes up sometimes because of the way PHP is set up on the server. I have no access to change anything like that so other suggestions would be VERY appreciated.
    <?php
    require_once “header.php”;
    $uid = (int)htmlentities(strip_tags($_GET['uid']));
    $actcode = htmlentities(strip_tags($_GET['actcode']));
    if (activateUser($uid, $actcode) == true)
    {
    echo “Thank you for activating your account, You can now login.
    Click here to login.“;
    } else
    {
    echo “Activation failed! Please try again.”;
    echo “If problem persists please contact the webmaster.”;
    }
    require_once “footer.php”;
    ?>

    Thanks!

  166. Gator Says:

    Great tut, learned alot from it, I was getting white screen on index page to0, my solution was, recopy an paste, turn out to be a bad copy of User Functions script, now i see login script, thnx again for the tut.

  167. Yutakai Says:

    hey if you are getting the clank page error make sure you named the functions.inc.php as functions.inc.php and NOT function.inc.php.

  168. Yutakai Says:

    hey if you are getting the blank page error make sure you named the functions.inc.php as functions.inc.php and NOT function.inc.php. Also make sure all your other files are there and have the correct names. The only one that was messed up is the functions.inc.php.

  169. Yutakai Says:

    Also for those of you getting the login error make sure you are putting the correct case. It is case sensitive.

  170. Denise Says:

    Hi I know this may seem stupid but ive everything done but not sure what values to use for DB, HOST, DBUSER and PASS. I know my DB is the actual database name and HOST is localhost but do I use the admin name and password for the rest? Whenever I go onto index.php i get the error :

    Could not connect!
    Please contact the site’s administrator.

    I have figured out that the problem is in this line of code in the db_connect.inc.php:
    $conn = mysql_connect(HOST, DBUSER, PASS) or die(‘Could not connect fdg!Please contact the site\’s administrator.’);
    ….if thats any help! I cant figure out how to actually get this working if someone could help me I would appreciate it so much!!!

  171. Hayley Says:

    How do I actually get this incorporated into my website? I have the website designed but do i just place the index.php code into the page??

  172. James Says:

    How can I get it to redirect to another page instead of displaying the userbox? Can anyone help? Thanks in advance.

  173. esseleakittex Says:

    You are absolutely right. In it something is also to me it seems it is excellent idea. I agree with you.
    subaction showcomments propecia archive posted

  174. Spuptmype Says:

    friendshelpingfriendshurricanereliefoth http://mike-mccormack.akhial.xorg.pl/hirove.html pictures of 2009 wimbledon hurricaneshutters

  175. Chan Says:

    Well,actually,i don’t think the login system is good since it has bugs,you can see a perfet advance membership system at tutorial.leathy.com,and see the efficent example link,the example is really great that better than the example this site teachs

  176. Chan Says:

    go to http://www.leathy.com,a social community

  177. tecnologia Says:

    Download files i zip file please…

  178. marie Says:

    Great tutorial,

    I am adding more pages to the user area, what is the protected script (session script) to use at the top of every new page so only logged in users can access the pages.

    Any help would be great!!!

  179. poorfarm Says:

    Looks like a good forum for whats going on.

    Be back soon

    poorfarm

  180. ami Says:

    very good. carry on

  181. rubberlattexfun Says:


    latex exam gloves lightly powered


    latex allergy powerpoint

    http://latex-porn.freehostia.com
    capes latex stories

  182. nathan Says:

    get
    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/dennis/domains/havefunteam.com/public_html/jona/php/header.php:14) in /home/dennis/domains/havefunteam.com/public_html/jona/php/index.php on line 9

    and when you click register thereis also an error

  183. margohelp Says:

    had recently herpes virus found in my blood. what I haveto do??? I’m in panic…

  184. Wairwaydiff Says:

    Our neighbors throing entire lot outside of the fridge! They ve bought pork recently and the proprietor said that it was from mexico! Should we not eat pork now?

  185. Geniengipsbit Says:

    Are you kidding me!!??? Swine FLU??? In sommer in heat? Is it undisturbed possible? I am from Cali and I on a tightrope! Slow blossoming!

  186. jacqueline Says:

    y it seem doesnt work? Anyone have this problem as well?

  187. dennis Says:

    thx for the tut, but doesnt work for me:(
    when i try to register and fill everything out it tells me
    registration failed, please try again.
    can someone help plz

  188. Bundweite Says:

    There are many interesting in this article. Auther is a good gyu

  189. Savindra Says:

    Hi,
    i found mistake in header.php file..

    find this :

    require_once (”functions.inc.php”);

    and replace with :

    require_once (”function.inc.php”); // without S in functions, we haven’t file functions.inc.php

    sorry for my english..
    —————————————————
    The above post helped me greatly….done by someone named bGr.
    Whoever you are thanks for the post. You are a life-saver.
    thanks again.

  190. wessel Says:

    Hello, first thnx for the great login system there is only one problem….

    I can not register.

    One time I could register I don’t know why but it worked one time and thats it.

    can someone please help.

    thnx

  191. weezerik Says:

    So nice information. Thx u a lot. I need to add it to my collection

  192. Lonichantiami Says:

    Contest of search enginges? Bing vs Google? Who do you point is prospering to win?

  193. unicydrarnild Says:

    Clash of search enginges? Bing vs Google? Who do you projection is successful to win?

  194. sami Says:

    Hi Gertjan

    Great tut – thanks for this

    In PHP 5.3, ereg is deprecated – I tried using preg_match but that needs a diff regex – enclosing the regex in / does not help…

  195. MikeMaster Says:

    I found my error, if someone has that problem with the white page, even if all names are correct, go to the header.php and change this:

    error_reporting(0); // we don’t want to see errors on screen

    Delete it, and then open the header.php in the browser, it should show you the error, and then just find a way to repair it

  196. Matthew Says:

    Everything works fine! but just one thing how do u make it so pages cannot be viewed unless the user is loged in?

  197. Dani Says:

    Im rewriting these scripts to a more compatibul form and easier to use.
    Like to code at the top and bottom of your page to protect it.

  198. Emile Says:

    I’m using this login script for a couple of month’s now and it is running fine under PHP 5.2. I have recently upgraded my server to PHP 5.3 and find out that this script isn’t compatible with that version of PHP. When i try to login with the correct username and password it says Incorrect login!

    I found out that login.functions.inc.php uses session_is_registered and that function is deprecated in version 5.3 and removed in PHP 6.0, I have replaced session_is_registered with ($_SESSION['loginid'] && ($_SESSION['username'])) but when i try to login it still says that the login is not correct!

    any ideas what i can do to solve this?

  199. herman Says:

    I still do not understand

  200. Ray Says:

    Nice Tutorial. But have a questionHow do you add name, address, street, ect.. to a register page and what process you do it at?

  201. julian Says:

    THANK YOU SO MUCH FOR THIS!!!!
    I kept having issues with this code and this is both comprehensive and simple. thank you so much for this simple, awesome tutorial

  202. Abe Says:

    Looks like a well thought out script.
    Shame a lot of the code is depricated… Any chance of an update?

  203. anonymous Says:

    What a complete waste of time. Doesn’t work, index.php is empty.

  204. anonymous Says:

    what a complete waste of time. index.php is empty, doesn’t do anything.

  205. anonymous Says:

    well go to the header file,remove the line error_reporting(0);
    refresh the index see what error it gives and fix it.
    i had an empty page too but i saw that i had forgotten to place a comma at the end of $conn = mysql_connect(HOST, DBUSER, PASS) or die(‘Could not connect !Please contact the site\’s administrator.’);

  206. mladen Says:

    registration failed please try again PLEASE HELP ME!!!!!!!

  207. Shota Says:

    mayebe because you are working on local server and page have problem with sending email

  208. mladen Says:

    When I register do not get email

  209. Max Says:

    Hi,

    regarding mail.functions.inc.php,
    I cannot use mail() to send emails as I need smtp authentication. My hosting service suggest to use the PEAR mail protocol but I am having problems adapting the script. Any help would be appreciated.
    Thanks
    M

  210. tldmic Says:

    hi, your code to load admin in mysql gives error about actcode, “does have default value”,what could be wrong,
    thanks

  211. punk3s3r Says:

    for see something in index.php rename function.inc.php for functions.inc.php add a “s” to function word, the login works very good for me

  212. Ekbal Says:

    thanks! this is one of the best tutorials ,keep it up.

  213. guest Says:

    script not working…. index are empty…

  214. hamed Says:

    thank u for this complete script.is it possible to stole cookies and reveal our password,..?

  215. anon Says:

    i just need to connect the DB and the login, i’m just a 2nd year college so i dont understand everything, can someone provide a little less complicated code? anyway, tnx for the code above and tnx for those who’re gonna help me

  216. Deepak Says:

    let me try..

  217. TJ Says:

    Need help with email; its not sending anything.

  218. TJ Says:

    tested login with admin details and it keeps coming up with ‘incorrect login information’. i know the details match the database so why?

  219. phildal Says:

    la reponse est dans l erreur !!!!!

    function.inc.php —> functions.inc.php

  220. Fleuv Says:

    It dasn’t work .. how the fock?? my index is empty

  221. Vincent Says:

    If you see empty index
    Here’s how to work above..

    open user.functions.inc.php

    error on line 73: (find and replace the text below)

    function registerNewUser($username, $password, $password2, $email)
    {
    global $seed;
    if (!valid_username($username) || !valid_password($password) ||
    !valid_email($email) || $password != $password2 || user_exists($username))
    {
    return false;

  222. Tsalagi Says:

    This is a great exercise for someone learning PHP if you apply yourself. Thanks for this hard work and sharing it!

    Abe: If you do some research the deprecated code can easily be fixed.

  223. JIM Says:

    I am building a little at a time. I have everything built to the index file. I have commented out the login line (I just want to see headers and footers work). If I don’t comment out the session_start() in the header file I get:
    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at C:\xampp\htdocs\mylms\index.php:3) in C:\xampp\htdocs\mylms\header_lms.php on line 4

    When I run the index file.

    Anyone got any ideas?
    Thanks

  224. tatr Says:

    When I logout it doesn’t redirect to the home page; its just blank. Anyone have any ideas?

  225. tatr Says:

    never mind i was missing a line :)

  226. jf28 Says:

    How do I use this code to protect certain pages from users who haven’t registered? I don’t get it. What code do I need to insert into my existing pages?

  227. EK Quah Says:

    When I install the database code, and i get an error of

    #1364 – Field ‘actcode’ doesn’t have a default value

    Thanks for helping at first.

  228. Tr1xeR Says:

    Try replacing it with `actcode` varchar(45) NOT NULL,

  229. Dark OmeN Says:

    @Vincent

    after that i got this error

    Parse error: syntax error, unexpected $end in C:\wamp\www\Advanced Login Script\user.functions.inc.php on line 129

  230. Dark OmeN Says:

    Sorry for double post but forgot the code ;O

    112. $query = sprintf(“update login set password = ‘%s’ where username = ‘%s’”,
    113. mysql_real_escape_string(sha1($newpass.$seed)),
    114. mysql_real_escape_string($username));
    115 if (mysql_query($query))
    116. {
    117. if (sendLostPasswordEmail($username, $email, $newpass))
    118. {
    119. return true;
    120. } else
    121. {
    122. return false;
    123. }
    124. } else
    125. {
    126. return false;
    127. }
    128.}
    129.?>

  231. ron Says:

    @Chan
    LEATHY.COM is a dating site, unless your posting the full, correct address, don’t waste our time

  232. WayOnHigh Says:

    This is the second time I have used these scripts.

    Just thought I should say Thanks!

    It seems a lot of people are complaining it’s not working correctly – this is not the case. It seems to work perfectly :-)

  233. WayOnHigh Says:

    Kary :
    Hello
    I published a post of a login member system in ajax
    If someone is interested, this is the url:
    http://www.recursosdelweb.com/como-hacer-un-sistema-de-login-en-ajax-y-php/
    bye!

    Do you have an english version of this?

  234. aRUWODI Says:

    I tried the tutorial above and it is not working for me. can anyone post me the a correct one that works. i just want to understand who everything works. im new at php.

  235. Jan Says:

    Hi,

    Could someone explain what the seed for passwords means in header.php?
    What does this do?

    Thank you

  236. Nithun Says:

    im not able to connect getting as

    Could not connect to database !
    Please contact the site’s administrator.

    should i have to change the below command

    $db = mysql_select_db(DB) or die(‘Could not connect to database !Please contact the site\’s administrator.’);

  237. ekquah Says:

    @Tr1xeR

    Hi, I get this error while insert value into the database. I not so sure what is the error caused it happen.

    INSERT INTO login( username,
    PASSWORD , email, activated ) value(
    ‘admin’,
    sha1( concat( ‘ekquah’, ’0dAfghRqSTgx’ ) ) ,
    ‘ekquah@gmail.com’,
    ’1′
    )

    MySQL said: Documentation
    #1364 – Field ‘actcode’ doesn’t have a default value

    Thanks.

  238. Nithun Says:

    im not able to connect getting as

    Could not connect to database !
    Please contact the site’s administrator.

    should i have to change the below command

    $db = mysql_select_db(DB) or die(‘Could not connect to database !Please contact the site\’s administrator.’);

  239. Rob Blanchard Says:

    nice man, not one problem.

  240. tanaxis Says:

    anonymous :what a complete waste of time. index.php is empty, doesn’t do anything.

    noob learn how to work with php dont just copy paste stuff, learn how to edit and make html and php your self!!

  241. jimbusk Says:

    I’m new to PHP. I’ve put up the script on the referenced website. It works great! Thanks…
    I have one question: If I want to display a different page (i.e. userpage.php) once the user has logged in instead of the index.php where do I make the change? Thanks in advance for your help.

  242. Ron™ Says:

    I have used this script on multiple websites now.
    Its easy to use, edit it and to extent it.
    Thnx for shareing this script!

  243. Emil Says:

    When i go to the site localhost/logon i get this messsage

    Warning: require_once(C:\xampp\htdocs\logon2\functions.inc.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\logon2\header.php on line 6

    Fatal error: require_once() [function.require]: Failed opening required ‘functions.inc.php’ (include_path=’.;\xampp\php\PEAR’) in C:\xampp\htdocs\logon2\header.php on line 6

    HELP PLEASE

  244. Rescue Leokeng Says:

    Thanks for the tutorial. I need urgent help. I want to add other fields to the registration page, can someone help me with the files that will have to reflect the additional fields I will be adding, like first name, lastname, employeeid

  245. Rick Marshall Says:

    I would like to make this work on my website. I am new to PhP, I have a pretty good programing history, but want to find a Partner to work with to make this system WORK. I have time and would like to make a small team or group to help each other. I want to integrate this in to existing web pages and use CSS too.

    Ricky krisfr@gmail.com

    ANY thoughts on how to accomplish this would be welcomed…..

  246. Ilse Says:

    Hey,
    I think this is a great script. I’ve got it working with the basics and now I’m trying to improve the script witha formchecker (to let the visitor know what exactly is wrong) and adding lots more. But therefore I’d like to know what the function is of:
    if ($disabled == true)
    {
    echo ‘disabled=”disabled”‘;
    }
    In the function show_loginform($disabled = false)

    This is the only place I see the disabled thing, besides the creation in the table and I have no idea what the use of it is. When does a user become disabled? I can’t find anything about that. Does anyone know what it is about? Cause I’m inclining to remove it completely, since I’ll be implementing userlevels as well……

    Thanks for the help!

  247. siva Says:

    thanks for the help

  248. siva Says:

    thanks for the code , its working well for me

  249. siva Says:

    thanks! this is one of the best tutorials ,its working and keep it up.

  250. Ian Piper Says:

    Nice tutorial – works fine. The only comment I would make is that the $seed global doesn’t really add much security value, because it is simply appended onto the password string. As a result the password table is vulnerable to a dictionary attack, because if two people use the same password they will get the same sha-1 string. A more secure approach would be to have a varying salt string (in place of the seed) stored in the login table. Then you do a sha-1 of the password plus the salt. That way you couldn’t use a dictionary attack – or rather you wouldn’t be able to spot by scanning the login table that someone has used the same password as someone else. Anyway, don’t want to gripe, because it’s a nice tutorial. Thanks.

  251. vincent Says:

    Gives register error. Can some one help?Thanks.

  252. Anthony Says:

    Can anyone give me script to add in to create a membership site with a pay section? The username would have limited access when they register and access to additional pages when they pay a subscription fee. Thanks.

  253. php programmer Says:

    Hi..,
    This is a nice script.. This script is working well.
    Its easy to understand.. Good job doing well.
    Thanks :-)

  254. Jacob Armstrong Says:

    Hello. I am building a website for my Virtual Airline. I have a little HTML knowledge and NO PHP knowledge. I was wondering if there was a way to where if a person doesn’t submit a PIREP (PIlot REPort), either manually or through 3rd party programs in a month’s period, it automatically sends their account to inactive, although I would still want them to be able to login and view their account and submit a PIREP before their time is up. After seven days it would automatically delete their account and they would have to reapply. This is off topic but, I was wondering if when they logged in, they could view a MySQL table (their PIREP’s)? Thanks for all your help in advance.

  255. Benjamin Says:

    @Ray
    It’s been some years ago, i’ve pickup up this script and i have the same problem. Did you, by any chance solved this?
    plaagmug@hotmail.com

  256. php_programmer Says:

    For those who are seeing blank index pages, make sure the php files are named correctly or as they are above. Also, as someone said, you do not want to have any spaces before the session_start() functions.

    Furthermore, if you cannot log in as admin. Try this: Go into the DB and assign an email address to the admin account if you have not already done so. Go back to the index.php page in your browser and click on the forgot password link. Type in admin for the username and the assigned email address. Now click on the reset password button. You should receive a new password in your email (the one you assigned to your admin account). Use this password to login and you should not have any problems logging on.

  257. jaap Says:

    if i try to register it says
    Registration failed! Please try again.
    I don’t receive any mail but the user appears in my database..
    somebody has a solution?
    thanks in advantage

  258. Nzelum Cosmas Says:

    Hello author, thanks a lot for the tutorial. This is among the best php login tutorials on net. I am a php learner and understands php from this your write up i tried to implement it on my site. I use windows XP and i have wamp. i used wampserver 2.0i to test your tutorial but i only saw a blank page both from the index and register page. i did everything according to your instruction even to the reply you said that we should check all filenames i did so. but i have found out that in your function.inc.php did u add ‘s’ to the function or not? i saved the files in a folder named ‘reg and login’ inside the www folder in wamp and changed everything to connect locally including the email as admin@localhost but when i preview the page i get only a blank white screen and the address reads http://localhost/reg%20and%20login/. please i would like you to help me out with this issue. thanks am waiting for your reply.

  259. OddyDJ Says:

    Wtf why is it not a download link i hate to copy every time i copy and make a texts dokument it fails so please make a

  260. Bill Says:

    @jaap

    Getting the same exact issue. Strangely it worked for the first registration, but not afterwards.

  261. thrhtrurth Says:

    apwaqzfuvduzmpyjtviox. acne treatment
    cuxdpz

  262. NewbAl3rt Says:

    Quick question, say I want to display all of the users that are logged in for a simple (Who’s Available) page; how would I pull that data from the database?

  263. Charles Says:

    Works great, thanks….I also had problems like the others who have posted. The key is to either put it on a live server or make sure your localhost server (XAMPP etc.) has the mail configured properly. I was having the same problems as others until I uploaded to the live server.

  264. Scapantynit Says:

    online banking personal ebony teen dating

  265. oplimots Says:

    Niksmake 1 Certainly. I agree with you.

    _____________
    ciallis
    female ingestion of
    6

  266. Rachid Says:

    Very Important: it works, i have only one prob : functions.inc ( i have function.inc) (copy paste :) ) but is very helpfull it works.

  267. Chad Bridges Says:

    I copied the code down to the t, then published it on my web server on proofofshipment.com/sandbox/ and I’ve been attempting to get it to connect to my database… it seems as if it won’t connect, although I’ve entered it correctly.

    There is not much I can do right now, my site is going to depend on a login system, and I really need to get this up and running… any thoughts?

    Respectfully,
    Proofofshipment Admin

  268. Chad Bridges Says:

    Also, when i go to proofofshipment.com/sandbox/login.php it says undefined error…?

  269. Chad Bridges Says:

    I have resolved most of the issues, but now, when i click “activate account” in the email the page says “No code supplied, even though it’s been supplied.” any ideas?

  270. Chad Bridges Says:

    I have everything working now, please check it out at proofofshipment.com/index.php , when i get the functionality up, it’s going to be awesome…

  271. Browneyadz Says:

    I don’t seem to be able to get it working. I’m going to develop my own usersystem and will release somewhere for you when i have time.

  272. ReD1 Says:

    Wow more than 260 comments But still none help us to download all this files in a zip file?!!!

    I’ve collected them and i made a zip file for those who want to download this tutorial http://red1.cwebh.org/login.zip

  273. ReD1 Says:

    in your tutorial there’s an error that’s what mades everyone got errors

    First you said in “Overview – Steps: 8. Creating a function.inc.php file”, but in code you named it functions.inc.php with the “S”, and you put “error_reporting(0);” in the index file so we don’t see this errors

    I’ve tested your tutorial it works well, thank you

  274. GholaMaster Says:

    @ReD1

    YOU’re A STUD!!! THANK YOU!!!

    I battled this thing, reading ALL 240+ comments, trying all fix attempts and investigating all errors to no avail. Maybe I made some mistakes in copying….who knows. But I downloaded your zipped version plugged it and BAM! …it’s all working now.

    Only thing that needed to be updated are the database login info (obviously) and the domain variable in the header.php to enable email notices (registrations/activations…etc).

    I wouldnt be greatful if I didn’t also give props the author of this tutorial. Great Stuff man! honestly the best all-in-one tutorial I’ve seen out there. I’m looking forward to working with this and hope to see updates to it someday. Thanks a million!

  275. Conrad Says:

    This Howto needs to be updated as for session_is_registered This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

    This right from the PHP website.
    If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister().

    This howto was well done, but now has security risk.

  276. ZizaX Says:

    Hello Gents,
    Firstly I have to say WELL DONE to author and thanks for sharing a brilliant script!!! The script is working like a charm and saving my time, however I have got a question… I am newbie to PHP, so please don’t beat me. After login the script will show user box on the same page. I would need to be redirected for a different page after login which will be still “under login” – that nobody will be allowed to view the page till login process is OK. What page do I need to adjust with what scripts? I assume I will only need to put some script at the very beginning of every protected page. Am I right? Please help. Many thanks!!!
    ZizaX.

  277. adeyemi Says:

    thank you for this great script, how can we make it to remember user password and nickname for autologin like facebook

  278. Hima unadkat Says:

    hiiii i really like this code..i hv made my own website for ART & ARTISTS. you all can check that. here is a URL. Art Gallery in mydazzlingart.com . This is a nice script. like to visit this website..

  279. norbesz2030 Says:

    Hi,
    anyone can help me?
    I cant register with this tutorial, only works the admin login.
    What must i do that if somebody registering to my site then the site sending the code to the email?

  280. Problema con script per il login - AlterVista | Spazio web gratis, hosting free php mysql Says:

    [...] [...]

  281. dan4 Says:

    @Conrad
    How to replace it?

  282. dan4 Says:

    Conrad :
    This Howto needs to be updated as for session_is_registered This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
    This right from the PHP website.
    If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister().
    This howto was well done, but now has security risk.

    How to replace it?

  283. brandon sookdeo Says:

    I am new to web design and i know nothing about programing. my boss wants me to create a user login and registration but i don’t know how to, please help!!

  284. Conrad Says:

    @dan4

    First go to the file login.functions.inc.php and look for this line:
    if (session_is_registered(‘loginid’) && session_is_registered(‘username’)

    Change it to:
    if (isset($_SESSION['loginid'] && $_SESSION['username'])

    Then go to the file logout.php

    Look for this line:
    if (session_unregistered(‘loginid’) == true && session_unregistered(‘username’) ==true )

    Change it to:
    if (!isset($_SESSION['loginid']) == true && $_SESSION['username'] == true )

    Also ergi and this is again form php.net

    Warning

    This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

    Use preg_match() instead.

  285. NotLazyBastard Says:

    OddyDJ :
    Wtf why is it not a download link i hate to copy every time i copy and make a texts dokument it fails so please make a

    wtf?? Lazy Bastard!

  286. Conrad Says:

    Here is the fixes for validation.functions.inc.php using preg_match instead of using ergi.

    $maxlength)
    {
    return false; // to long
    }
    if (strlen($username) < $minlength)
    {

    return false; //toshort
    }

    $result = preg_match("/^[A-Za-z0-9_\-@]+$/", $username);

    if ($result)
    {
    return true; // ok no invalid chars
    } else
    {
    return false; //invalid chars found
    }

    return false;

    }

    function valid_password($pass, $minlength = 6, $maxlength = 15)
    {
    $pass = trim($pass);

    if (empty($pass))
    {
    return false;
    }

    if (strlen($pass) $maxlength)
    {
    return false;
    }

    $result = preg_match(“/^[A-Za-z0-9_\-@]+$/”, $pass);

    if ($result)
    {
    return true;
    } else
    {
    return false;
    }

    return false;

    }

    ?>

  287. Conrad Says:

    @Conrad
    Here is the missing top half

    $maxlength)
    {
    return false; // to long
    }

  288. brandon sookdeo Says:

    ok I managed to put all the files together but it’s giving me an error. “Could not connect !
    Please contact the site’s administrator.” please help!!!

  289. Ollie Says:

    I am struggling to understand where the $u and $p come from in the checkLogin function. Could anyone please explain where these variables are defined?

    Thanks

  290. brandon sookdeo Says:

    Can someone show me what goes on this part of the code:

    define(“HOST”, “localhost”);
    // Database user
    define(“DBUSER”, “dbuser”);
    // Database password
    define(“PASS”, “dbpass”);
    // Database name
    define(“DB”, “dbname”);

    Thanks

  291. brandon sookdeo Says:

    hello Hima unadkat

    You manged to solve this script, can you help me out and BTW I AM ALSO AN ARTIST.

    THANKS

  292. brandon sookdeo Says:

    @Hima unadkat

    hELLO mR Hima unadkat

    i WAS WONDERING SINCE YOU KNOW HOW TO MAKE THIS WORK, WOULD YOU BE WILLING TO HELP ME OUT THANKS

  293. brandon sookdeo Says:

    I added a link on my home pg to the login.php file and it gives me this error:

    Fatal error: Call to undefined function isloggedin() in /home/dagadget/public_html/login.php on line 2

    Can anyone help?

    Thanks

  294. brandon sookdeo Says:

    how do you get your database password and username?

    thanks

  295. brandon sookdeo Says:

    how do you know what a database password is?
    Thanks

  296. MD.Khursid Alam Says:

    mysql

    insert into login (username,password,email,activated) value (‘admin’,sha1(concat(‘yourpasswordhere’,’0dAfghRqSTgx’)),’youremailhere’,’1′);

    Error:1364 : Field ‘actcode’ doesn’t have a default value

    how can i solve this problem.

    plzzz reply me anyone . Thanks .

  297. David Says:

    Hi Guys,

    I am new to this, I need some help.
    I followed the login tutorial above, but I am just getting a blank screen.

    Questions

    1. am I suppose to put these files in one a folder when I put them in public folder in the hosting server?

    2. I have removed all the spaces between the lines but still hasn’t fixed the problem.

    3. The only thing I have changed is the hosting, user name, password and db name in the db_connection.inc file.

    This seems to be working ok. Because I can query the table and and the admin db I have created fine.

    Pls if anyone had experience similar issue let me know your solution.

    Regards

    David

  298. PHP /Dreamweaver CS3 => Members Systeem - 9lives - Games Forum Says:

    [...] te vinden zijn: http://www.evolt.org/node/60384 Member systeem Creating a Membership System Complete advanced login member system – PHP tutorial | ineedtutorials.com member systeem – PHP tutorials – PHPhulp Membersysteem met pm systeem | Ledensystemen | PHP scripts [...]

  299. Electric Lord Says:

    1.GOOGLE (indispensable!!)
    2.PHP HOW TO
    3.1000s of people who ever had the same problem to solve

    else{ try echo “;)” }

  300. mith Says:

    hi.. m new in php.. but i tried using this login form and it says function loggedIn not defined. where m i going wrong??

  301. mith Says:

    To be precise……”Fatal error: Call to undefined function isLoggedIn() in D:\xampp\xampp\htdocs\login\changepassword.php on line 5

  302. Michael Says:

    First Thanx for the tutorial.
    for me is working fine in xampp webserver V 1.7.3,

    now only 1 part i need it is ( rememeber me ) session and include with this tutorial

  303. Michael Says:

    just check out the db_connect.inc and verified with u database is same.

    check the phpmyadmin with ur current user wether it is root or some else this part must match with ur ((( db_connect.inc ))).

    TRY OUT

    Best of Luck !!!!

  304. @yo3n Says:

    gud,,,,gud,,,gud,,,
    pas bgt buat tugas saya..
    :)

  305. totoddapace Says:

    Likvidace a odvoz papiroveho odpadu.

    Hlidani deti, Prace na zahrade, Palivove drevo, Instalaterske prace, Zednicke prace, Malirske prace, Lakyrnicke prace http://ceskeforum.com/viewtopic.php?f=67&t=1133

  306. Dwards Says:

    Hey, I need to style up the page… with frames and a nice design…. Help out !!!

  307. STEP 2 Says:

    I have done step 1 correctly, but i cant get passed step 2.
    I save the “db_connect.inc.php” file in a new folder but phpMyAdmin wont let me import it…

    Anyone know what do to? Thanks!
    (and yeah I’m not a pro, but im learning more and more)

    J

  308. Non-camera Phone Says:

    M1 Student…

    [...]I think it has a immense level of effort to attain such work in graphic graphics. Must be a[...]…

  309. Marc Says:

    Could you help me that Michael? With the remember me?

  310. Marc Says:

    Do you have a zipped version? :P

  311. Negative Says:

    Very very Thankks, wanderfull a project ♥

  312. Lee Says:

    NOTE: in the header.php edit out the error reporting:

    ‘error_reporting(0); // we don’t want to see errors on screen’

    just a quick // at the start will save a world of pain!

    ‘//error_reporting(0); // we don’t want to see errors on screen’

    You do want to see the errors to find them to fix them!

  313. Cameron Says:

    Very Nice tutorial! Although the order you described the different files in was confusing, It’s still a good tutorial.

  314. Fashion Designer In Karachi Says:

    Nice tutorials I like when i struck in advance Programming when i use google , google is my Teacher i love u Google :*

  315. Shaneka Landell Says:

    why does the index.php page doesn’t display anything?

  316. irul Says:

    why does the index.php page doesn’t display anything?
    me too

  317. Leon Says:

    Thanks for great tutorial, everything worked as expected.. However now I need to move login table to another server (non php) and having problem decoding user passwords which were created with sha1 hashing and static seed string.. Any idea how to go about it this migration..?

    Thanks
    Leon

  318. Leon Says:

    Actually nevermind, the new server also supports sha1 in another language which I am using called Velocity, so I am able to apply its sha1 function to the seed and user entered password combination to match the values in my login table.. Thanks!

  319. Goutham Says:

    Thanks a lot …
    Keep up the good work ….

  320. Tyson Says:

    I need help where do I put the info for my DB_Connect?

    I know what everthing is, I’m not sure where to add it.

  321. vamsi Says:

    I’m getting this error will you plz rectify it “Deprecated: Function ereg() is deprecated in /var/www/vamsi/login_system/validation.functions.inc.php on line 62
    Registration failed! Please try again”

  322. geoge Says:

    u9ZGgA http://fnYwlOpd2n9t4Vx6A3lbk.com

  323. JamesV Says:

    @vamsi

    Change all ocurrences of ereg to preg_match

    @tyson

    in the file db_connect.inc.php
    look for this:

    define(“HOST”, “localhost”);
    // Database user
    define(“DBUSER”, “typeyourdbuserhere”);
    // Database password
    define(“PASS”, “typeyourdbpasshere”);
    // Database name
    define(“DB”, “typeyourdbnamehere”);

  324. antiosuwas Says:

    [img]http://www.007magazine.co.uk/images/news/dvd/packshots.jpg[/img]

    [b]NO PASSWORD – LINKS ARE INTERCHANGEABLE[/b]

    [code]http://www.filesonic.com/folder/833415[/code]
    [code]http://www.wupload.com/folder/113638[/code]
    [code]http://fileserve.com/list/W5tQsZ2[/code]
    [code]http://uploadstation.com/list/Jf7kGHy[/code]

    [b]1. Dr. No[/b]

    James Bond’s investigation of a missing colleague in Jamaica leads him to the island of the mysterious Dr. No and a scheme to end the US space program.

    [b]2. From Russia With Love[/b]

    James Bond willingly falls into an assassination ploy involving a naive Russian beauty in order to retrieve a Soviet encryption device that was stolen by SPECTRE.

    [b]3. Goldfinger[/b]

    Investigating a gold magnate’s gold smuggling, James Bond uncovers a plot to contaminate the Fort Knox gold reserve.

    [b]4. Thunderball[/b]

    James Bond heads to The Bahamas to recover two nuclear warheads stolen by SPECTRE agent Emilio Largo in an international extortion scheme.

    [b]5. You Only Live Twice[/b]

    Agent 007 and the Japanese secret service ninja force must find and stop the true culprit of a series of spacejackings before nuclear war is provoked.

    [b]6. On Her Majesty’s Secret Service[/b]

    James Bond woos a mob boss’s daughter and goes undercover to uncover the true reason for Blofeld’s allergy research in the Swiss Alps that involves beautiful women from around the world.

    [b]7. Diamonds are Forever[/b]

    A diamond smuggling investigation leads James Bond to Las Vegas, where he uncovers an extortion plot headed by his nemesis, Ernst Stavro Blofeld.

    [b]8. Live and Let Die[/b]

    007 is sent to stop a diabolically brilliant heroin magnate armed with a complex organization and a reliable psychic tarot card reader.

    [b]9. The Man with the Golden Gun[/b]

    Bond is led to believe that he is targeted by the world’s most expensive assassin and must hunt him down to stop him.

    [b]10. The Spy Who Loved Me[/b]

    James Bond investigates the hijacking of British and Russian submarines carrying nuclear warheads with the help of a KGB agent whose lover he killed.

    [b]11. Moonraker[/b]

    James Bond investigates the mid-air theft of a space shuttle and discovers a plot to commit global genocide.

    [b]12. For Your Eyes Only[/b]

    Agent 007 is assigned to hunt for a lost British encryption device and prevent it from falling into enemy hands.

    [b]13. Octopussy[/b]

    A fake Fabergé egg and a fellow agent’s death leads James Bond to uncovering an international jewel smuggling operation, headed by the mysterious Octopussy, being used to disguise a nuclear attack on NATO forces.

    [b]14. Nerver Say Never Again[/b]

    A SPECTRE agent has stolen two American nuclear warheads, and James Bond must find their targets before they are detonated.

    [b]15. A View to a Kill[/b]

    An investigation of a horse-racing scam leads 007 to a mad industrialist who plans to create a worldwide microchip monopoly by destroying California’s Silicon Valley.

    [b]16. The Living Daylights[/b]

    James Bond is living on the edge to stop an evil arms dealer from starting another world war. Bond crosses all seven continents in order to stop the evil Whitaker and General Koskov.

    [b]17. Licence to Kill[/b]

    James Bond leaves Her Majesty’s Secret Service to stop an evil drug lord and avenge his best friend, Felix Leiter.

    [b]18. Goldeneye[/b]

    James Bond teams up with the lone survivor of a destroyed Russian research center to stop the hijacking of a nuclear space weapon by a fellow agent believed to be dead.

    [b]19. Tomorrow Never Dies[/b]

    James Bond heads to stop a media mogul’s plan to induce war between China and the UK in order to obtain exclusive global media coverage.

    [b]20. The World Is Not Enough[/b]

    James Bond uncovers a nuclear plot when he protects an oil heiress from her former kidnapper, an international terrorist who can’t feel pain.

    [b]21. Die Another Day[/b]

    James Bond is sent to investigate the connection between a North Korean terrorist and a diamond mogul who is funding the development of an international space weapon.

    [b]22. Casino Royale[/b]

    In his first mission, James Bond must stop Le Chiffre, a banker to the world’s terrorist organizations, from winning a high-stakes poker tournament at Casino Royale in Montenegro.

    [b]23. Quantum of Solace[/b]

    Seeking revenge for the death of his love, secret agent James Bond sets out to stop an environmentalist from taking control of a country’s valuable resource.

    [b]NO PASSWORD – LINKS ARE INTERCHANGEABLE[/b]

    [code]http://www.filesonic.com/folder/833415[/code]
    [code]http://www.wupload.com/folder/113638[/code]
    [code]http://fileserve.com/list/W5tQsZ2[/code]
    [code]http://uploadstation.com/list/Jf7kGHy[/code]

  325. JUAN CARLOS Says:

    hi im juan carlos
    im not expert in php but i want learn
    just have a php and mysql enable
    i work with appserv and ive php 5
    but i dont know how activate php mail and ftp
    please help meeee!!!!

    just have 11 years old

    thanls

  326. buy twitter follower Says:

    I got what you intend, saved to fav, very decent web site .

  327. fredricz Says:

    – Doesnt work. Want to specify the path in the include.

    Thank,

  328. fredricz Says:

    [code] [/code]

    – Doesnt work. Want to specify the path in the include.

    Thanks,

  329. FeralmOssyses Says:

    Just wanna comment on few general things, The website design is perfect, the articles is really superb : D.

  330. KeeklyHerneks Says:

    [url=http://www.uggiaustralianorge.com]ugg australia norge[/url]

    http://www.uggsinorge.eu

  331. BenOthede Says:

    audi s6 характеристики
    Компания Audi объявила о начале приема заказов на ограниченную серию суперкаров Audi RS6 Plus. Партия всего в 500 экземпляров будет вручную собрана на предприятии quattro GmbH, дочерней компания Audi AG. Как заявили в компании, RS6 Plus сочетает в себе бескомпромиссный спортивный характер легендарной серии RS с комфортом представительского седана: автомобиль оснащен бензиновым V10 с непосредственным впрыском и двойным турбонаддувом, развивающим до 580 л. с. мощности и до 650 Нм крутящего момента в диапазоне от 1500 до 6250 оборотов в минуту. По своим характеристикам этот седан не уступает скоростным спортивным автомобилям: всего за 4,5 с он разгоняется от 0 до 100 км/ч и проходит отметку 200 км/ч уже через 14,5 с. Максимальная же скорость составляет 303 км/ч. Клиенты смогут выбрать один из двух пакетов комплектации: Sport или Audi exclusive, при этом каждый автомобиль будет снабжен уникальным шильдиком, обозначающим его порядковый номер в серии. Последний Audi RS6 Plus ограниченной серии покинет сборочную линию в июле 2010 года.
    audi q5 тюнинг [URL=http://certifiedyd.iversonhosting.com/forum-bmw-id557/bmv-36-kuzov.html]бмв 36 кузов[/URL] audi r8 салон
    официальный диллер audi [URL=http://alphabetcin.fall.vn/forum-bmw-id560/audi-q7-oboi.html]audi q7 обои[/URL] audi диски
    audi rs4 характеристики [URL=http://glutinenm.netfast.org/forum-bmw-id955/bmv-grand-turizmo.html]бмв гранд туризмо[/URL] новые авто ауди
    audi обои [URL=http://indionxx.free-website.biz/forum-bmw-id361/audi-a6-kharakteristika.html]audi a6 характеристика[/URL] audi 100 1981
    audi купе [URL=http://disgruntledrb.websitehostfree.com/forum-bmw-id366/bmv-sport.html]бмв спорт[/URL] audi джип
    салон audi [URL=http://jennybr.manga-mail.com/forum-bmw-id118/mashyny-bmv.html]машыны бмв[/URL] характеристики audi a4
    тюнинг audi allroad [url=http://wideworldofwomen.net/Forum/viewtopic.php?f=21&t=152721]audi 80 ремонт[/url] audi a3 отзывы
    audi самара [url=http://forum.neodelight.com/viewtopic.php?p=308006#308006]audi 100 1997[/url] audi s5 фото
    audi a7 фото [url=http://www.darlingnikkie.com/cgi-bin/cgiwrap/jade4u/yabb/YaBB.pl?num=1325708864/0#0]продам audi[/url] автопродажа в россии
    автомобиль ауди а4 [url=http://viajeroentransito.com/blogs/?p=72#comment-15691]фото audi a5[/url] audi q8 фото

  332. NeedMypeapaky Says:

    Ahhhh I can’t contain myself. I think she’s amazing.

    I think her name is Julia Robovini [img]http://mydatingprofileis.com/images/5/2.jpg[/img]

    What do you think of her?

  333. Moohagmadlome Says:

    decide on clutches, tote bags, flap bags, hobo bags plus a selection of other kinds of bags, from Chanel shops.browsing, suitable from the comfort and ease of their own personal households.Contrary to the particular retail outlet, the net retailer is not going to haveprogram, everyone needs a cheaper deal. There is nothing mistaken from purchasing from on line sellers just be eageryou desire, with no thoroughly breaking the bank.Never ever has it been easier to individual these coveted brand names andcompared to outlined price tag. So, using a small bit of research and with some volume of luck, it definitely is usually [url=http://www.cheapchanelbagsonline.com/chanel-cavier-leather-bags-c-77.html]Classic Chanel Bag[/url] want?There’s an interactive search alternative that could make product or service searches very easy for you. Just form inhas all the items on the market, ranging from perfumes to add-ons, clothes, belts, shoes and evenon the bags, ranging from deals to ‘one bag absolutely free with another’ offers. It will always be fantastic to keep a examineon line outlets of various suppliers is the purpose why that they had diverse cost charges. But watch out for fauxunique product of a bag or some outfits merchandise which isn’t detailed around the Chanel official online store,

  334. prace Says:

    Hello. I’am new here.

  335. krarinkas Says:

    Hi forum! I need to ask some questions in discipline to be given our application started.

    Master: (personal to fabric)
    We’ve known each other since college way (temperament modus operandi) back in our country. We bumped into each other this year Feb 2011 just as I started to duty a new job. We’ve became lovers since then. She’s has a PR here and I’m on a work visa, granted we acquire correspond to jobs; she just now has two and I can on the contrary function allowing for regarding one. As time went next to we bought a auto, rent a purpose, a joint bank accnts due to the fact that the pile charter out; we both pay back against it, pictures, etc.. this relationship is on account of real.

    Recently, She opened up more a common-law relevance, b/c she wants us to shake up to a different concern and wants me to abolished with her and she knows the hassles of applying work visas but she can postponed til the PR reference goes through. “It grant us more versatility,” she says.
    I upright comprehend about this material and I know you have to be a least a year in the relationship to declare this to immigration.

    Questions:
    1- when we reach a year (Feb 2012) can we file an practice licit there and then?

    2- what more does the immigration want pro us to prove?

    3- she has kids, would that be a factor(tottopicentoze)?

    4- we both have acceptable earnings and even-handed if we lacuna up *belief not* I am more than skilled to take up the cudgels for myself;
    do we have to declare it to immigration that we did and balls all the hassles?

    5- I’m already here over the extent of almost 3 years sometimes, admitted legally, can we send the app to Buffalo to have a faster processing or do we send it in-land and sit tight forever? And, the advantage of an plead if in all cases we send it to Buffalo…

    6- what is the odds of an interview?

  336. Jamesm Says:

    Did they release another update to the way google ranks websites? Ive noticed over the past few days some websites seem to bounce from ranks one to page two etc. This high rate of fluctuation makes me wonder what bases determine a websites’s rankings and whether changes in the results are determined by changes made in Google’s system or within the websites itself. If I had to guess, I believe this determination is based on a combination of changes both within Google and persistent tweaking of a website that could keep it balanced somewhere on page one.

  337. Akbar Says:

    Is there really anybody out there that believes they are giving away free ipods on facebook? lol I am also very scared that a masked man is going to kill me if I don’t send out that chain letter.

  338. gindibliowl Says:

    Whether you just desire to eat healthful meals or else you can be a committed vegetarian, you’ll not believe what number of delicious dishes there are for you personally within this book.

  339. ReefFederob Says:

    Hi

    I’m a guy who love roasting, and having a good hours along with my loved ones.
    It is usually great when like in spring I spend a lot of effort in the kitchen with my children, doing a bit of plates or a number of cakes.

    The best is strawberry shortcake, however also like cooking food meat pie and other dinners like this.
    Attraction prefer vacationing and so meetting completely new men and new us.

    Send me a PM if you value my presentation !

  340. jordemasweaclw Says:

    Hello,
    Very interesting name near your forum wedsite.
    All can be wonderful.
    The possession of full power will pass a despot of almost any man.
    Goodbay!

  341. Edd Says:

    Love the tutorial but has anyone made an update page that allows the users to edit their profile?

    I have had a go but with no luck!!

  342. gennicknyt Says:

    I think it’s good idea to do it

  343. John Says:

    @ Edd

    mysql_query(“Update login SET email = ‘$newemaill’ WHERE loginid = ‘$uid’”);

Leave a Reply