Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Goes to this page if there is not cookie:
  2. <?php
  3.  
  4. $check = $_COOKIE['cUser'];
  5.  
  6. if(!$check){
  7. header("Location: https://cits-silverneon123-1.c9.io/user/user.html");
  8. }
  9.  
  10. ?>
  11.  
  12. upon login (wont work)...
  13.  
  14. <?php
  15.  
  16. $user = $_POST['user'];
  17.  
  18. $pass = $_POST['pass'];
  19.  
  20. if(!file_exists('../cUser/' . $user . '/')){
  21.  
  22. header("Location: https://cits-silverneon123-1.c9.io/user/join.html");
  23.  
  24. }else{
  25.  
  26. $hash = hash('ripemd160', $pass);
  27.  
  28. $getPass = file_get_contents("../cUser/" . $user . "/pass.txt");
  29.  
  30. if($hash == $getPass){
  31.  
  32. setcookie("cUser", $user, time() + (86400 * 7));
  33. setcookie("cPass", $pass, time() + (86400 * 7));
  34. header("Location: https://cits-silverneon123-1.c9.io/");
  35.  
  36. }else{
  37.  
  38. header("Location: https://cits-silverneon123-1.c9.io/user/login.html");
  39.  
  40. }
  41.  
  42. }
  43.  
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement