Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. $id=$row['id'];
  2. $password=$row['password'];
  3. $time=md5(time().$password);
  4. $userid=$id.":".$time;
  5.  
  6. setcookie("userid",$userid,time() +3600*24*120);
  7. list($id_user,$hash) = explode(':',$_COOKIE['userid']);
  8. mysql_query("UPDATE users SET cookie='$hash' WHERE id='$id'",$connect) or die(mysql_error());
  9. header("Location: index.php");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement