Hellrocker

Untitled

Oct 15th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "roydl7";
  4. $password = "lolwtf";
  5. $dbname = "hackathon";
  6. date_default_timezone_set("Asia/Kolkata");
  7. $logtime = date('Y-m-d H:i:s');
  8. $CRLF = "\n\r";
  9.  
  10. $conn = mysql_connect("localhost", $username, $password);
  11.  
  12. if (!$conn)
  13. {
  14. die('Could not connect: ' . mysql_error());
  15. }
  16. $con_result = mysql_select_db("hackathon", $conn);
  17. if(!$con_result)
  18. {
  19. die('Could not connect to specific database: ' . mysql_error());
  20. }
  21.  
  22. $sql = "SELECT * FROM `current` ORDER BY unix_timestamp(STR_TO_DATE(`log`, '%Y-%m-%d %h:%i-%s')) DESC LIMIT 1";
  23. $result = mysql_query($sql);
  24.  
  25. if (!$result) {
  26. die('Invalid query: ' . mysql_error());
  27. }
  28.  
  29. $row = mysql_fetch_array($result)
  30. if($row[1] == '0')
  31. {
  32. $to = "siddharth16871687@gmail.com";
  33. $sub = "CURRENT REACHED 0";
  34. $mail = '
  35. <html>
  36. <head>
  37. <title>tasrfew</title>
  38. </head>
  39. <body>
  40. Yo niga yo request has been accepted, ok
  41. </body>
  42. </html>
  43. ';
  44. $headers = 'MIME-Version: 1.0' . "\r\n";
  45. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  46. $headers .= 'From: gmail <siddharth16871687@gmail.com>' . "\r\n";
  47. mail($to, $sub, $mail, $headers);
  48. echo "EMAIL SENT";
  49. }
  50.  
  51.  
  52. mysql_close($conn);
  53. ?>
Add Comment
Please, Sign In to add comment