Jul 26, 2008

Complete Login System - With PHP + MYSQL

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials
Pages: 1, 2, 3, 4, 5, 6

free web hosting

Complete Login System - With PHP + MYSQL

FaLgoR
Its an complete login sistem made and tested by me and I think itwill be very usefull for people who are tryn to learn PHP.

First, let's make register.php:

CODE
<?
include("conn.php"); // create a file with all the database connections

if($do_register){ // if the submit button were clicked
if((!$name) || (!$email) || (!$age) || (!$login) || (!$password) || (!$password2)){
print "You can't let any fields in blank.\n"; // if the user did not put some field
exit;
}
$name = stripslashes($name);
$email = stripslashes($email);
$age = stripslashes($age);
$login = stripslashes($login);
$password = stripslashes($password);
$password2 = stripslashes($password2);

// this is for security reasons

if($password != $password2){ // if passwords didn't match
print "The password and the confirmation are not the same!\n";
exit;
}
$password = md5($password);
mysql_query("INSERT INTO table (name,email,age,login,password) VALUES ('$name','$email',$age,'$login','$password')") or die (mysql_error());
print "Done!\n"; // if its okay, show this message
exit;
} // close the first "if"
?>

<form action="register.php" method="post">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Age: <input type="text" name="age"><br>
Login: <input type="text" name="login"><br>
Password: <input type="password" name="password"><br>
Password Again: <input type="password" name="password2"><br>
<input type="submit" name="do_register" value="Sumbit">
</form>


And now 'conn.php', which is 'included' in the above file.

CODE

$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'yourdb';
mysql_connect($host,$user,$pass) or die ("Database is unavaiable. Please try again later.");
mysql_select_db($db) or die ("Database is unavaiable. Please try again later.");


Notice from jlhaslip:

I have cut and pasted the missing 'conn.php' in here to avoid all the confusion about it having been missed in the original version of the tutorial.
Most of the following posts concern this out-of-place file, so this note might help explain why they are there.


And now, login.php:

CODE
<?
include("conn.php");

if($do_login){
$login = stripslashes($login); // VERY IMPORTANT FOR SECURITY OF YOUR DATABASE DON'T ERASE IT
$passwd = stripslashes($passwd); // VERY IMPORTANT FOR SECURITY OF YOUR DATABASE DON'T ERASE IT

$check = mysql_query("SELECT * FROM table WHERE login='$login' LIMIT 1;");
$user = mysql_fetch_array($check);

if($user[password] == md5($passwd)){ // if the writed password and the db password are the same...

setcookie("login","$login",time()+360000);
setcookie("pass","$passwd",time()+360000);
// ...set the cookies...
header("Location: userspage.php"); // ...and redirect to restrict page
}else{
print "Login or password incorrects!\n";
exit;
}
}
?>

<form action="login.php" method="post">
Login: <input type="text" name="login"><br>
Passwd: <input type="password" name="passwd">
<input type="submit" name="do_login" value="Log-in!">
</form>

And finally, userspage.php:

CODE
<?
if(isset($HTTP_COOKIE_VARS["login"])){
?>

Page contents here

<?
}else{
?>
This page is restrict for registered users only!
<?
}
?>


verify.php:
CODE

<?
include("conn.php"); // include page with the database connection
$cookie = $HTTP_COOKIE_VARS; // to reduce the var's name :o)

if($cookie[login] && $cookie[pass]){

$login = $cookie[login];
$pass = $cookie[pass];

$usrquery = mysql_query("SELECT * FROM members WHERE nick='$login' AND password='$pass';") or die (mysql_error()); // search for the user
$user = mysql_fetch_array($usrquery);

if($user[level] != 'Admin')
header("Location: notfound.htm"); // if the user is not an admin, redirect to an error page
}
?>


admin.php:
CODE
<?
include("verify.php"); // it will verify if the user is an admin
?>
<!-- Here, the table with all the members -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td>
       <form method="post" action="members.php">
         <table width="100%" border="0" cellspacing="3" cellpadding="0">
           <tr bgcolor="#333333">
             <th width="6%" class="header"><font size="1">Editar</font></th>
             <th width="1%" class="header"><font size="1">ID</font></th>
             <th width="24%" class="header"><font size="1">Name</font></th>
             <th width="13%" class="header"><font size="1">Age</font></th>
             <th width="40%" class="header"><font size="1">E-Mail</font></th>
             <th width="11%" class="header"><font size="1">Details...</font></th>
           </tr>
<?
$query = mysql_query("SELECT * FROM members ORDER BY id;");
if(!mysql_fetch_array($query)) // If there is no members
print "<tr><td align=\"center\" colspan=\"7\"><font color=\"#FFFFFF\" size=\"2\"><b>Sorry, there is no members registered.</b></font></td></tr>\n";
// Show you a message

while($profiles = mysql_fetch_array($query))
{
?>
           <tr bgcolor="#666666">
             <td> <div align="center"><input type="checkbox" name="id[]" value="<?=$profiles[id]?>"></div></td>
             <td> <div align="center"><?=$profiles[id]?></div></td>
             <td> <div align="center"><?=$profiles[name]?></div></td>
             <td> <div align="center"><?=$profiles[age]?></div></td>
             <td> <div align="center"><?=$profiles[email]?></div></td>
             <td> <div align="center"><a href="profiles.php?op=edit&id=<?=$profiles[id]?>" target="_blank">More info...</a></div></td>
           </tr>
<?
}
?>
         </table>
       </td>
   </tr>
 </table>
</form>

Done, now, profiles.php (used to see and edit member information):
CODE
<?
include("verify.php"); // always put this page, or everybody would have access to this page

function Update (&$member, $table, $data)
{
   global $id;
   $items = explode(" ",$data);
$update = "";
$i = 0;
while ($tmp = $items[$i++])
{
 $data = $member[$tmp];
 if (is_numeric($data))
  $update .= "$tmp=$data";
 else
 {
       sqlQuotes($data);
  $update .= "$tmp='$data'";
       }
 if ($items[$i]) $update .= ",";
}
mysql_query("UPDATE $table SET $update WHERE id=$member[id];");

}
// this function is really nice!!

switch($op){
case 'edit': // if you're trying to edit/see info
$profile = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE id=$id;")); // save the user informations on an variable
?>
<!-- now, lets show an table -->
 <form action="profiles.php?op=doedit&memberid=<?=$profile[id]?>" method="post">
   <table width="100%" border="0" cellspacing="3" cellpadding="0">
     <tr>
       <td width="25%"><font color="#FFFFFF">ID</font></td>
       <td width="75%"><input name="id" type="text" id="id" value="<?=$profile[id]?>" size="2"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Name</font></td>
       <td><input name="name" type="text" id="nome" value="<?=$profile[name]?>" maxlength="32"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Age</font></td>
       <td><input name="age" type="text" value="<?=$profile[age]?>" maxlength="32"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Country</font></td>
       <td><input name="country" type="text" id="estado" value="<?=$profile[country]?>" size="2" maxlength="2"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">City</font></td>
       <td><input name="city" type="text" id="cidade" value="<?=$profile[city]?>"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">ICQ</font></td>
       <td><input name="icq" type="text" id="icq" value="<?=$profile[icq]?>"></td>
     </tr>
     <tr>
       <td height="22"><font color="#FFFFFF">MSN</font></td>
       <td><input name="msn" type="text" id="msn" value="<?=$profile[msn]?>"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">HP</font></td>
       <td><input name="hp" type="text" id="hp" value="<?=$profile[hp]?>" size="40"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">E-mail</font></td>
       <td><input name="email" type="text" id="email" value="<?=$profile[email]?>" maxlength="60"></td>
     </tr>
     <tr>
       <td colspan="2">&nbsp;</td>
     </tr>
     <tr>
       <td colspan="2"><div align="center">
           <input type="submit" value="Save">
           &nbsp;
           <input type="reset" value="Reset">
         </div></td>
     </tr>
   </table>
 </form>
<?
break;
case 'doedit':
if(!$memberid)
return;

$profile[name] = $name;
$profile[age] = $age;
$profile[country] = $country;
$profile[city] = $city;
$profile[icq] = $icq;
$profile[msn] = $msn;
$profile[hp] = $hp;
$profile[email] = $email;

Update($profile,"members","name age country city icq msn hp email");
mysql_query("UPDATE members SET id=$id WHERE id=$memberid;"); // update user's id

EndNow("Details saved!<br><br><a href=\"admin.php\">Back</a>");

break;
}
?>


Try to don't only copy the code and post into your site. If you do it, you will learn nothing with this tut. I hope it have been usefull for you! wink.gif

 

 

 


Reply

zachtk8702
Hey looks great. If someoen is just learning PHP i asusme theyre not familiar with MYSQL alreayd so maybe add something about putting tables in a database........ Maybe a php script would be easiest for them. Just an Idea.

Reply

novaforme
Well I run appserv off my own computer at my house so I can test pages and such before i post them, Well i tested this and all i got back was warnings.

Warning: main(conn.php): failed to open stream: No such file or directory in e:\www\login\verify.php on line 10

Warning: main(conn.php): failed to open stream: No such file or directory in e:\www\login\verify.php on line 10

Warning: main(): Failed opening 'conn.php' for inclusion (include_path='.;c:\php4\pear') in e:\www\login\verify.php on line 10

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\www\login\admin.php on line 28

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\www\login\admin.php on line 32

Reply

FaLgoR
QUOTE(novaforme @ Feb 17 2005, 02:21 AM)
Well I run appserv off my own computer at my house so I can test pages and such before i post them, Well i tested this and all i got back was warnings.

Warning: main(conn.php): failed to open stream: No such file or directory in e:\www\login\verify.php on line 10

Warning: main(conn.php): failed to open stream: No such file or directory in e:\www\login\verify.php on line 10

Warning: main(): Failed opening 'conn.php' for inclusion (include_path='.;c:\php4\pear') in e:\www\login\verify.php on line 10

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\www\login\admin.php on line 28

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\www\login\admin.php on line 32
*



Man, I you have to make an file called conn.php, with the database connections beofre runing the script
here is an example:

CODE

$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'yourdb';

mysql_connect($host,$user,$pass) or die ("Database is unavaiable. Please try again later.");
mysql_select_db($db) or die ("Database is unavaiable. Please try again later.");


Put this file at the login directory and it will works =]

 

 

 


Reply

Music
mext time.... Show what EACH code does so people can edit it an so forth wink.gif

Reply

maddog39
Wow quoting that post was majorly cheating hosting points but whatever. Also, I dont see any MySQL what so ever and I also dont think its hard to make an install file and yeah you forgot a database connector file. That really needs to be fixed.

Reply

FaLgoR
QUOTE
Next time.... Show what EACH code does so people can edit it an so forth wink.gif


This is riduculous! The guy quote all the topic to comment only it! Cheater post!

QUOTE
Wow quoting that post was majorly cheating hosting points but whatever. Also, I dont see any MySQL what so ever and I also dont think its hard to make an install file and yeah you forgot a database connector file. That really needs to be fixed.


You have only to edit conn.php file to your needs.

Reply

karlo
Why do you use stripslashes()? Can't you use $_GET or $_POST?

Reply

doom145
whyme says: huge unessasry quote deleted

thx i have been looking something in the region of this......I am havin problems with my login php...I have made my own php login system but it didnt work so I guess I have to use this.....My problem is that it runs the code i dont want it to run and hence it logs into my whm lol.....so I am thigering out how to NOT copy u but have help from the tutorial rolleyes.gif

Reply

shadowdemon
Thanks for the help. I have had trouble with these codes cause they never worked but cant wait to try it

Reply

Latest Entries

williamm
QUOTE(FaLgoR @ Feb 15 2005, 04:38 PM) *
Its an complete login sistem made and tested by me and I think itwill be very usefull for people who are tryn to learn PHP.

First, let's make register.php:

CODE
<?
include("conn.php"); // create a file with all the database connections

if($do_register){ // if the submit button were clicked
if((!$name) || (!$email) || (!$age) || (!$login) || (!$password) || (!$password2)){
print "You can't let any fields in blank.\n"; // if the user did not put some field
exit;
}
$name = stripslashes($name);
$email = stripslashes($email);
$age = stripslashes($age);
$login = stripslashes($login);
$password = stripslashes($password);
$password2 = stripslashes($password2);

// this is for security reasons

if($password != $password2){ // if passwords didn't match
print "The password and the confirmation are not the same!\n";
exit;
}
$password = md5($password);
mysql_query("INSERT INTO table (name,email,age,login,password) VALUES ('$name','$email',$age,'$login','$password')") or die (mysql_error());
print "Done!\n"; // if its okay, show this message
exit;
} // close the first "if"
?>

<form action="register.php" method="post">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Age: <input type="text" name="age"><br>
Login: <input type="text" name="login"><br>
Password: <input type="password" name="password"><br>
Password Again: <input type="password" name="password2"><br>
<input type="submit" name="do_register" value="Sumbit">
</form>


And now 'conn.php', which is 'included' in the above file.

CODE
$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'yourdb';
mysql_connect($host,$user,$pass) or die ("Database is unavaiable. Please try again later.");
mysql_select_db($db) or die ("Database is unavaiable. Please try again later.");


Notice from jlhaslip:

I have cut and pasted the missing 'conn.php' in here to avoid all the confusion about it having been missed in the original version of the tutorial.
Most of the following posts concern this out-of-place file, so this note might help explain why they are there.


And now, login.php:

CODE
<?
include("conn.php");

if($do_login){
$login = stripslashes($login); // VERY IMPORTANT FOR SECURITY OF YOUR DATABASE DON'T ERASE IT
$passwd = stripslashes($passwd); // VERY IMPORTANT FOR SECURITY OF YOUR DATABASE DON'T ERASE IT

$check = mysql_query("SELECT * FROM table WHERE login='$login' LIMIT 1;");
$user = mysql_fetch_array($check);

if($user[password] == md5($passwd)){ // if the writed password and the db password are the same...

setcookie("login","$login",time()+360000);
setcookie("pass","$passwd",time()+360000);
// ...set the cookies...
header("Location: userspage.php"); // ...and redirect to restrict page
}else{
print "Login or password incorrects!\n";
exit;
}
}
?>

<form action="login.php" method="post">
Login: <input type="text" name="login"><br>
Passwd: <input type="password" name="passwd">
<input type="submit" name="do_login" value="Log-in!">
</form>

And finally, userspage.php:

CODE
<?
if(isset($HTTP_COOKIE_VARS["login"])){
?>

Page contents here

<?
}else{
?>
This page is restrict for registered users only!
<?
}
?>


verify.php:
CODE
<?
include("conn.php"); // include page with the database connection
$cookie = $HTTP_COOKIE_VARS; // to reduce the var's name :o)

if($cookie[login] && $cookie[pass]){

$login = $cookie[login];
$pass = $cookie[pass];

$usrquery = mysql_query("SELECT * FROM members WHERE nick='$login' AND password='$pass';") or die (mysql_error()); // search for the user
$user = mysql_fetch_array($usrquery);

if($user[level] != 'Admin')
header("Location: notfound.htm"); // if the user is not an admin, redirect to an error page
}
?>


admin.php:
CODE
<?
include("verify.php"); // it will verify if the user is an admin
?>
<!-- Here, the table with all the members -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td>
       <form method="post" action="members.php">
         <table width="100%" border="0" cellspacing="3" cellpadding="0">
           <tr bgcolor="#333333">
             <th width="6%" class="header"><font size="1">Editar</font></th>
             <th width="1%" class="header"><font size="1">ID</font></th>
             <th width="24%" class="header"><font size="1">Name</font></th>
             <th width="13%" class="header"><font size="1">Age</font></th>
             <th width="40%" class="header"><font size="1">E-Mail</font></th>
             <th width="11%" class="header"><font size="1">Details...</font></th>
           </tr>
<?
$query = mysql_query("SELECT * FROM members ORDER BY id;");
if(!mysql_fetch_array($query)) // If there is no members
print "<tr><td align=\"center\" colspan=\"7\"><font color=\"#FFFFFF\" size=\"2\"><b>Sorry, there is no members registered.</b></font></td></tr>\n";
// Show you a message

while($profiles = mysql_fetch_array($query))
{
?>
           <tr bgcolor="#666666">
             <td> <div align="center"><input type="checkbox" name="id[]" value="<?=$profiles[id]?>"></div></td>
             <td> <div align="center"><?=$profiles[id]?></div></td>
             <td> <div align="center"><?=$profiles[name]?></div></td>
             <td> <div align="center"><?=$profiles[age]?></div></td>
             <td> <div align="center"><?=$profiles[email]?></div></td>
             <td> <div align="center"><a href="profiles.php?op=edit&id=<?=$profiles[id]?>" target="_blank">More info...</a></div></td>
           </tr>
<?
}
?>
         </table>
       </td>
   </tr>
 </table>
</form>

Done, now, profiles.php (used to see and edit member information):
CODE
<?
include("verify.php"); // always put this page, or everybody would have access to this page

function Update (&$member, $table, $data)
{
   global $id;
   $items = explode(" ",$data);
    $update = "";
    $i = 0;
    while ($tmp = $items[$i++])
    {
 $data = $member[$tmp];
 if (is_numeric($data))
     $update .= "$tmp=$data";
 else
 {
       sqlQuotes($data);
     $update .= "$tmp='$data'";
       }
 if ($items[$i]) $update .= ",";
    }
    mysql_query("UPDATE $table SET $update WHERE id=$member[id];");

}
// this function is really nice!!

switch($op){
case 'edit': // if you're trying to edit/see info
$profile = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE id=$id;")); // save the user informations on an variable
?>
<!-- now, lets show an table -->
 <form action="profiles.php?op=doedit&memberid=<?=$profile[id]?>" method="post">
   <table width="100%" border="0" cellspacing="3" cellpadding="0">
     <tr>
       <td width="25%"><font color="#FFFFFF">ID</font></td>
       <td width="75%"><input name="id" type="text" id="id" value="<?=$profile[id]?>" size="2"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Name</font></td>
       <td><input name="name" type="text" id="nome" value="<?=$profile[name]?>" maxlength="32"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Age</font></td>
       <td><input name="age" type="text" value="<?=$profile[age]?>" maxlength="32"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">Country</font></td>
       <td><input name="country" type="text" id="estado" value="<?=$profile[country]?>" size="2" maxlength="2"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">City</font></td>
       <td><input name="city" type="text" id="cidade" value="<?=$profile[city]?>"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">ICQ</font></td>
       <td><input name="icq" type="text" id="icq" value="<?=$profile[icq]?>"></td>
     </tr>
     <tr>
       <td height="22"><font color="#FFFFFF">MSN</font></td>
       <td><input name="msn" type="text" id="msn" value="<?=$profile[msn]?>"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">HP</font></td>
       <td><input name="hp" type="text" id="hp" value="<?=$profile[hp]?>" size="40"></td>
     </tr>
     <tr>
       <td><font color="#FFFFFF">E-mail</font></td>
       <td><input name="email" type="text" id="email" value="<?=$profile[email]?>" maxlength="60"></td>
     </tr>
     <tr>
       <td colspan="2">&nbsp;</td>
     </tr>
     <tr>
       <td colspan="2"><div align="center">
           <input type="submit" value="Save">
           &nbsp;
           <input type="reset" value="Reset">
         </div></td>
     </tr>
   </table>
 </form>
<?
break;
case 'doedit':
if(!$memberid)
return;

$profile[name] = $name;
$profile[age] = $age;
$profile[country] = $country;
$profile[city] = $city;
$profile[icq] = $icq;
$profile[msn] = $msn;
$profile[hp] = $hp;
$profile[email] = $email;

Update($profile,"members","name age country city icq msn hp email");
mysql_query("UPDATE members SET id=$id WHERE id=$memberid;"); // update user's id

EndNow("Details saved!<br><br><a href=\"admin.php\">Back</a>");

break;
}
?>


Try to don't only copy the code and post into your site. If you do it, you will learn nothing with this tut. I hope it have been usefull for you! wink.gif


hey FaLgoR can i ask you how good you are with php? I need to put together something for a client and i was wondering if i could ask you for some help, not very good at php yet. thanks if you can't its cool just wondering.

Reply

alex1985
But, there are still some mistakes in it?!

Reply

minimcmonkey
Wow, nice tutorial!!!!
brillaint script.
Might try this later!!

cool thread!

Reply

coldasice
QUOTE(Acid @ Dec 27 2007, 02:38 PM) *
It's just some codes, that I am missing to make mine work.
Not that I am stealing from it, but I am learning by reading. wink.gif


okey then its allowed smile.gif blush.gif

Reply

Acid
QUOTE(coldasice @ Dec 27 2007, 05:19 AM) *
if its ur own.. u dont need any parts smile.gif

It's just some codes, that I am missing to make mine work.
Not that I am stealing from it, but I am learning by reading. wink.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3, 4, 5, 6
Recent Queries:-
  1. complete login in php - 6.56 hr back. (2)
  2. #profile-name {color:#ffffff; - 21.90 hr back. (2)
  3. password - 37.98 hr back. (1)
  4. multiple logins with php and mysql - 38.65 hr back. (1)
  5. login system - 42.63 hr back. (1)
  6. how to create a login system in php mysql - 60.77 hr back. (1)
  7. php secure login system explode cookie - 67.55 hr back. (1)
  8. creating a login system with mysql and php - 67.60 hr back. (1)
  9. how to login system use mysql database - 69.74 hr back. (1)
  10. login with verify php tutorial - 81.43 hr back. (1)
  11. complete system in php and mysql - 89.42 hr back. (1)
  12. php login system - 91.90 hr back. (2)
  13. login system update password php mysql - 103.54 hr back. (1)
  14. how to set up a mysql login system - 110.76 hr back. (1)
Similar Topics

Keywords : complete, login, system, php, mysql

  1. Getting Started With Mysql
    creating tables and insert data into them. (2)
  2. To Automatically Run Command When Login / Logoff
    (3)
    In case that you need login and / or logoff to execute some commands. You could do this with GPO
    login / logoff function. Here is step: 1.) Choose Start Menu -> Run -> type in gpedit.msc 2.)
    Expand User -> Windows Settings ->Script ( Logon / Logoff ) 3.) Double-Click either one and a dialog
    displayed 4.) Click the add button and then browse the command files that you wish to executed. The
    Script Parameters allowed you to pass any extra parameters to the command or applications. Click OK
    button. 5.) You command now should displayed on Name / Parameters List Box. Click O....
  3. Simple Php Login And Registration System
    (10)
    Hello. This is my first web tutorial ever. This is basically a simple register and login script.
    Yes, I know it’s a bit rubbish but I’m quite new to PHP/MySQL. Here’s the register form. This can
    be any file extension you like. I’d recommend calling it register.html . CODE
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
    xmlns="http://www.w3.org/1999/xhtml"> <head> <meta
    http-equiv="Content-Type" content="text/ht....
  4. Adding Data To A Database And Displaying It Later
    Using Forms, PHP and MySQL (1)
    Requirements: PHP Support MySQL Database access I am going to use a news program as an example.
    Ok, first you are going to need to connect to the database. Do so by using the code below. I have
    added some comments where you will need to edit to fit your server's specifications. Create a
    new file with notepad and call it config.php QUOTE //Change root to your database
    account's username $dbusername = "root"; //Add your account's password in between the
    quotations $password = " "; //Add the name of the database you are using in betw....
  5. Simple User System
    php, mysql driven (19)
    Hey! Maybe you've seen my other tutorials...or my signature.. Anyways I'm going to show
    you how to make a system so users of your site could register accounts and you could have protected
    - user only - pages on your site /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> Ok, so we start by creating a config.php file. CODE <?php
        $dbhost   = 'database host';     $dbname   = 'database name';
        $dbusername   = 'database username';     $dbuserpass = 'database pas....
  6. Simple Shoutbox
    PHP, MySQL driven.. (34)
    Ok, so I'm going to show you how to create a very basic shoutbox which is driven with PHP and a
    MySQL database. So, lets start - open a database management program like PHPMyAdmin and run these
    queries. SQL CREATE TABLE `shoutbox` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT
    , `name` VARCHAR( 255 ) NOT NULL , `mail` VARCHAR( 255 ) NOT NULL , `time`
    VARCHAR( 255 ) NOT NULL , `message` TEXT NOT NULL , `ip` VARCHAR( 255 ) NOT NULL ,
    PRIMARY KEY ( `id` ) ) TYPE = MYISAM ; CREATE TABLE `shoutbox_a....
  7. Cpanel Mysql Database Management
    Part 2.1 Of My 7 Part Cpanel Tutorial (6)
    This tutorial is an extension to my 7 tutorial series about the Cpanel. The 7 different Cpanel
    tutorials can be found below. Part 1: E-mail Management Part 2: Useful Site Management Tools
    Part 3: Useful Site Management Tools2.1 Part 4: Analysis/Log Files Part 5: Advanced Tools Part
    6: PreInstalled Scripts, Extras, and Cpanel Options Part 7: Fantastico Detailed Cpanel
    Tutorial Part 2.1: MySQL Management In this tutorial, i will explain how to add, edit, delete
    and over-all manage the MySQL Feature in the Cpanel. Creating a MySQL Database 1) ....
  8. Starting Or Stopping Apache And Mysql Server Via Batch File
    (0)
    Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT
    (2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL
    installed as Windows Services. So we can stop and start it using NET command. For more information
    about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql"
    and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run >
    services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. ....
  9. Flatfile User Login/signup
    Uses text files only (compatable with forums and message system) (24)
    With this tutorial, you will learn how to create a textfile login script. This user membership
    script is for use also with my forums and message system scripts. I will also give you the scripts
    to make it so that people can change their profiles. Ok, The first thing we need to do is make the
    database. To do this, create a blank text file called 'userdata.txt' , make sure it is ALL
    LOWER-CASE. Edit this file and put
    '**username|##|password|##|email|##|rank|##|userid|##|name|##|picture**'. This will not be
    used, however it will give you an idea of how the....
  10. Check Referrer To Prevent Linking Yours From Other Sites
    Check referrer with Php and Mysql (8)
    Check Referrer Using Php To Prevent People Linking To Your Downloads From Other Sites Ever
    find that found some people are listing items, images and tuts and linking directly to the download
    url (those that are like my photoshop tutorial.php?id=0), which is a .php to count the number of
    downloads. To prevent this, you can add a piece of code to the download pages that checks which page
    referred them to the download page: if it's my domain, it downloads the file normally, if
    it's not, it will redirect to my home page instead. Important : Not all browser....
  11. Quiz With Php, But Without Mysql
    (3)
    Ok let`s start! Once I wrote it for school: At first we need questions (php) CODE
    $form_block = " <p>Quiz</p> <form method=\"POST\"
    action=\"$_SERVER[PHP_SELF]\">
    <p><strong>What's The Capital City Of England?</strong><br>
    <input type=\"text\" name=\"q1\"
    value=\"$q1\" size=30></p> <p><strong>How Many
    Letters Are There In The Alphabet?</strong>&....
  12. Installing Php + Mysql + Apache + Phpmyadmin On Windows Part 2
    Continue the last section which is installing phpMyadmin (0)
    QUOTE phpMyAdmin lets you control you MySQL database from a web browser. Steps: 1. If you
    haven't done so already, download the phpMyAdmin Database Manager - You can download the
    software from the phpMyAdmin website. Be sure to download the phpMyAdmin-2.6.2-pl1.zip file. Save
    the file on your Windows Desktop. ... ... ... Go to for more info. Post Copied. Member
    Banned ....
  13. Searching With Php And Mysql
    The easy way :P (2)
    Searching with PHP and MySQL is pretty easy when you think about it, especially if you're doing
    it the simple way (without boolean or whatever) /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> It consists of a few forms, a query and an
    output. As I said, simple! CODE <form name=\"form1\"
    id=\"form1\" method=\"post\" action=\"<?
    $php_self ?>\"> <table width=\"100%\"
    border=\"0\" cellspacing=\&#....
  14. Automatic Login
    in WinXP (5)
    Ever wanted to just turn on our computer and when you get back it's already on the desktop?
    (Rather then having to login at the welcome screen) Now some computer have this feature by default,
    but what if it gets broken, try this. On an Administrator account goto start >> Run, and type
    "control userpasswords2" (without the quotes) Uncheck the box that "Users must enter a Username and
    Password to use this computer", then press Ok. You will be prompted to enter a default user and
    their pasword, then next time you restart the computer it will automaticaly login to that....
  15. Install Php 5 To Work With Mysql
    (0)
    hi, all php 5 is new to all people a long time( actually, I forget how long...). it introduced a
    more object-oriented design to developer. like, access type(public, private, protected), abstract
    type(classes that can't create objects), interface support, and more . althrought it is
    widerly available, someone still can't get it running with mysql. every time the php is starting
    up. a message prompted stated that some xtensions can not be found, and therefore, not loaded. so, I
    have written this to help other and newbie get it start quickly. note: thi....
  16. A Nice Mysql Server Check
    (4)
    I made this and its not very hard at all just fill in the info and it willl see if your mysql is up
    or down CODE <html> <head> <title> Mysql Connection Test
    </title> </head> <body> <h2> <?php // On this you need to put
    your host most of the times localhost username and password. $conncect = mysql_connect (
    "host", "Username", "password" ) or die (" Sorry your server
    can't connect to your mysql server <BR> Check to see you have put in the Username and....
  17. Mysql Database Setup
    tutorial walk through (1)
    Post copied. Google cache to source Credits have been adjusted. Setting Up Your MySQL &
    phpMyAdmin For The First Time This tutorial will show you how to set up your MySQL and your
    phpMyAdmin with ease, regardless of whether you are going to be using PHP Nuke or PHP Nuke
    Platinum. The process is still the same. -Log into your CPanel with your User Name and Password.
    -Click on MySQL icon -Now, we need to create a database also known as Db , Your User Name will
    make up part of the necessary details, but you don't need to do this as it will be done au....
  18. Php Dynamic Signatures
    Using the GD Module and MySQL (9)
    PHP Dynamic Signatures using the GD Module After much scowering on the internet to find a
    suitable tutorial on this subject, I came up empty-handed. So I was forced to learn it on my own
    through trial & error. And since I had discovered a lack of tutorials on this subject, I dediced to
    write one! Working Example: Abstract : Using the GD Module of PHP allows a
    developer to build custom Images with Dynamic Content. Such content could be the Requesting Users
    IP Address, Web-Browser Type, Operating System, even the number of times the user has see....
  19. Backing Up And Restoring Mysql Databases
    (10)
    If you're an Administrator on a Forum, you probably know the importance of regular data backups.
    My Forum is always being hacked by someone and they always delete our SQL Databases. Well this
    tutorial is for all of you who want to protect your data and restore it if necessary! Okay,
    backing up your data is the first part. I use Cron Jobs in my cPanel to automate the backup
    process. Just use this code for backing up all your SQL Databases: CODE mysqldump -u root
    -psecret --all-databases > backup.sql OR if you wish to backup only a single database: ....
  20. Simple Login In Visual Basic 6
    user interaction example trough login programm (5)
    First of all, I am NOT a programmer, this is something my friend taught me. It describes basic
    interaction with the user, while showing basic functionality of this simple programm. So, without
    further ado, we're off to the tutorial: First of all, start your visual basic, when prompted
    for new project, select Standard Exe . Next, we need to open code window, so we can start typing
    the program. This can be done in two ways, one is double clicking on the form, or selecting Code
    from View menu. If you double clicked on the form, you will see following text: CODE ....
  21. How To Put A Phpbb Login Box On Your Main Site.
    Code and .php included!!! (18)
    I have included my coded file with this... Ok here is the code. CODE // //Create login area,
    replace the phpBB2 in /phpBB2/login.php with your forum's //directory // <form
    action="/phpBB2/login.php" method="post" target="_top"> <table
    width="25%" cellspacing="2" cellpadding="2" border="0"
    align="center">  <tr> <td align="left"
    class="nav"><a href="/phpBB2/index.php" class="nav">Prank Place
    Forum Index</a></td>....
  22. Php/mysql Login/register
    Tutorial for login with databases. (2)
    Start register code. Register.php CODE <form method=post
    action=register.php?action=register  name=s> <table>
    <tr><td>Username:</td><td><input type=text
    name=user></td></tr>
    <tr><td>Email:</td><td><input type=text
    name=email></td></tr>
    <tr><td>Pass:</td><td><input type=password
    name=pass></td></tr> <tr><td>Verify
    Pass:</td><td><input ....
  23. Complete Login And Registration System
    doesn't use mysql! (9)
    kLogin 0.1 QUOTE(readme.txt) Readme file to kLogin 0.1 To use the internet explorer fix:
    download the latest IE7 ZIP file
    (http://sourceforge.net/project/showfiles.php?group_id=109983&package_id=119707) Extract the ie7
    zip file to the root directory of your web server. Example, if you are using a unix/linux server,
    it's on "public_html/" or "home/public_html" Open kLogin.php file with your editor and edit the
    $info_text or $info_txt variable. Then, extract the kLogin.php file in to the root
    directory of your web server also. Just run kShoutBo....
  24. How To Host Ur Own Site In 2 Mins Php+mysql Needed
    (34)
    QUOTE Run you're own server for testing phpmysql or just to host you're own website or
    for you're friends. -needS: a PC that's all 8) - How to ? download : CODE
    http://server.paehl.de/apache20.zip : 30 seconds Installing:---> 1 minute
    *********************************** Unpack the exe where ever you want. after unpack run
    serverinst.exe and change Servername and your e-mail. Start the following files one time:
    start_apache.cmd --> start apache as service mysql_start_as_service.cmd  --> dito for mysql
    mysql_first_st....
  25. Shoutbox, Made Easy
    PHP+MySQL ShoutBox! Very simple... (17)
    Just create a PHP file named "kShoutBox.php" CODE <?php header("Content-type:
    text/html; charset=utf-8"); //Send to browser that the charset is utf-8 ?> <?php
    /* ******************************   kShoutBox 0.1 ****************************** */
    /* **************************************** This ShoutBox script was created by Juan Karlo Aquino
    de Guzman DO NOT MODIFY THIS CODE AND DISTRIBUTING IT WITHOUT ANY PERMISSION. E-MAIL THE AUTHOR
    FIRST. Email: 01karlo@gmail.com DO NOT REMOVE THE "POWERED BY". FOR SUGG....
  26. Multiple Admin Login (php)
    This is a script that doesnt requre SQL (3)
    first off make a login.html page Code: QUOTE Admin Login Username: Password:
    then make a check.php page Code: QUOTE $admin1 = "admin1"; //
    first admin username $adm_pass1 = "password1"; // first admin password $admin2 =
    "admin2"; // second admin username $adm_pass2 = "password2"; // second admin password
    if(($username == $admin1 && $password == $adm_pass1) || ($username ==
    $admin2 && $password == $adm_pass2)){ echo "Congratulations " . $_POST . " ....
  27. Php Simple Login Tutorial
    Learn how to make a simple login! (63)
    I have been quite busy lately, trying to design and code my site (far from done XD). And after
    having learned how to make a simple login, I will try to write my own tutorial, for you
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> the tutorial Step 1
    : The first step in designing a member system is to plan out exactly what you need. A common impulse
    among programmers is to jump right in and start coding. I'll be honest and admit that I'm
    guilty of this more so than anyone. However, since I'm in control of this conversation (y....
  28. Clicks Counter
    With PHP + MySQL (0)
    Well, in this tut, I'll show you how to do an simple link counter, with only one count for each
    IP and the date when the link were clicked. Just remember, this is only one way to do it. First,
    create an mysql database called 'links', with 2 table: first table will be called
    'links', with the columns: id, title, ref and clicks. The other one will be 3 columns and
    will be called links_info: id, ip and date. Just remember that the columns 'id' of this
    second table IS NOT auto-increment. Here is the code of the file which will count the clicks, ....
  29. A Guide On Webhosting, Php, Mysql, And Phpmyadmin
    (0)
    I thought I'd submit this little guide of mines, after I gave my friend an impromptu
    introduction on this. I hope those who are new to PHP and MySQL will fin this usefull. What is
    PHP? PHP is a scripting program, you install PHP into your server, BUT, you can only do it if you
    have "physical" access to the server, (i.e. - you can close the server, add stuff to the server,
    clear the server, remove the server). People who have web hosting accounts CAN NOT install PHP,
    because, they only "own" a part of the server. You must be the server administrator in order to ins....

    1. Looking for complete, login, system, php, mysql

Searching Video's for complete, login, system, php, mysql
Similar
Getting
Started With
Mysql -
creating
tables and
insert data
into them.
To
Automaticall
y Run
Command When
Login /
Logoff
Simple Php
Login And
Registration
System
Adding Data
To A
Database And
Displaying
It Later -
Using Forms,
PHP and
MySQL
Simple User
System -
php, mysql
driven
Simple
Shoutbox -
PHP, MySQL
driven..
Cpanel Mysql
Database
Management -
Part 2.1 Of
My 7 Part
Cpanel
Tutorial
Starting Or
Stopping
Apache And
Mysql Server
Via Batch
File
Flatfile
User
Login/signup
- Uses text
files only
(compatable
with forums
and message
system)
Check
Referrer To
Prevent
Linking
Yours From
Other Sites
- Check
referrer
with Php and
Mysql
Quiz With
Php, But
Without
Mysql
Installing
Php + Mysql
+ Apache +
Phpmyadmin
On Windows
Part 2 -
Continue the
last section
which is
installing
phpMyadmin
Searching
With Php And
Mysql - The
easy way :P
Automatic
Login - in
WinXP
Install Php
5 To Work
With Mysql
A Nice Mysql
Server Check
Mysql
Database
Setup -
tutorial
walk through
Php Dynamic
Signatures -
Using the GD
Module and
MySQL
Backing Up
And
Restoring
Mysql
Databases
Simple Login
In Visual
Basic 6 -
user
interaction
example
trough login
programm
How To Put A
Phpbb Login
Box On Your
Main Site. -
Code and
.php
included!
;!!
Php/mysql
Login/regist
er -
Tutorial for
login with
databases.
Complete
Login And
Registration
System -
doesn't
use
mysql!
How To Host
Ur Own Site
In 2 Mins
Php+mysql
Needed
Shoutbox,
Made Easy -
PHP+MySQL
ShoutBox!
; Very
simple...
Multiple
Admin Login
(php) - This
is a script
that doesnt
requre SQL
Php Simple
Login
Tutorial -
Learn how to
make a
simple
login!
Clicks
Counter -
With PHP +
MySQL
A Guide On
Webhosting,
Php, Mysql,
And
Phpmyadmin
advertisement



Complete Login System - With PHP + MYSQL



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE