daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 28th, 2016 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     session_start();
  3.     if (isset($_POST["btnsubmit"]))
  4.     {
  5.         $nm=$_POST["username"];
  6.         $pwd=$_POST["password"];
  7.         $conn = new mysqli("localhost", "root", "", "simple_login");
  8.     // Check connection
  9.         if ($conn->connect_error)
  10.         {
  11.             die("Connection failed: " . $conn->connect_error);
  12.     }
  13.  
  14.     $sql = "select * from member where username='$nm' and password='$pwd'" ;
  15.     $result = $conn->query($sql);
  16.     if ($result->num_rows > 0) {
  17. //        to add sesssion value
  18.         $_SESSION["memid"]=$row["mem_id"];
  19.         $_SESSION["username"]=$row["username"];
  20.         header("location:demo2.php");
  21.         }
  22.     } else { echo "wrong username or password" ; }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top