Guest User

Untitled

a guest
May 20th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1.         $host="mysql10.000webhost.com";
  2.         $username="";
  3.         $password="";
  4.         $db_name="";
  5.         $tbl_name="Users";
  6.          
  7.         mysql_connect("$host", "$username", "$password")or die("cannot connect");
  8.         mysql_select_db("$db_name")or die("cannot select DB");
  9.          
  10.         $myusername=$_POST['username'];
  11.         $mypassword=$_POST['password'];
  12.         $myidentify=$_POST['id'];
  13.          
  14.          
  15.         $sql= mysql_query("SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword' and id='$myidentify'");
  16.          
  17.         $rows = mysql_fetch_array($sql);
  18.         $username = $rows['Username'];
  19.         if ($username == $myusername) {
  20.         setcookie("cookie_username", $myusername, time()+3600);
  21.         setcookie("cookie_password", $mypassword, time()+3600);
  22.         setcookie("cookie_password", $myidentify, time()+3600);
Add Comment
Please, Sign In to add comment