Login System PHP Script


Login System PHP Script

Login System in PHP

Learn how to create a secure login system in PHP and MySQL. This script contains the login form for the registered user to login into his account.It prevents MySQL injection that makes it difficult for your site to be hacked.

Example Source Code

 

Code:
 
  1. <?php
  2. include ("connection.php");
  3. if (isset($_SESSION["SESS_MEMBER_ID"]))
  4.       {
  5.       $result = mysql_query("SELECT member_id FROM `member` WHERE `member_id`='" . $_SESSION["SESS_MEMBER_ID"] . "' LIMIT 1");
  6.       if (mysql_num_rows($result))
  7.             {
  8.             $row = mysql_fetch_array($result);
  9.             $_SESSION["logged"] = $row["member_id"];
  10.             }
  11.       }
  12. ?>

 

 

 

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

"