Guest User

Untitled

a guest
May 5th, 2018
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. $host="127.0.0.1";
  4. $user="user";
  5. $pass="pass";
  6. $database="database";
  7. $table="table";
  8. $expire="50"; // expire time in seconds
  9.  
  10. function check_valid($t)
  11. {
  12. if (time-$t > $expire) return 0; else return 1;
  13. }
  14.  
  15. $db=mysql_connect($host, $user, $pass);
  16. if(!$db)
  17. die(mysql_error());
  18. $db=mysql_select_db($database);
  19. if(!$db)
  20. die(mysql_error());
  21.  
  22. $nh = $_GET['n'];
  23.  
  24. if ( $nh )
  25. {
  26. echo "$nh<br>";
  27.  
  28. $res=mysql_query("SELECT * FROM $table WHERE nfo_rlsname ='$nh'");
  29.  
  30. if(mysql_num_rows($res) > 0)
  31. {
  32.  
  33. $row=mysql_fetch_array($res);
  34. if ( check_valid($row['unixtime']) == 1 ) {
  35. echo str_replace("\n", "<br>", $row['nfo_data']);
  36. }
  37. else {
  38. echo "Expired..";
  39. }
  40. }
  41. else
  42. {
  43. echo "Nothing found";
  44. }
  45. }
  46. else
  47. {
  48. echo "No input";
  49. }
  50.  
  51. ?>
Add Comment
Please, Sign In to add comment