Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "roydl7";
- $password = "lolwtf";
- $dbname = "hackathon";
- date_default_timezone_set("Asia/Kolkata");
- $logtime = date('Y-m-d H:i:s');
- $CRLF = "\n\r";
- $conn = mysql_connect("localhost", $username, $password);
- if (!$conn)
- {
- die('Could not connect: ' . mysql_error());
- }
- $con_result = mysql_select_db("hackathon", $conn);
- if(!$con_result)
- {
- die('Could not connect to specific database: ' . mysql_error());
- }
- $sql = "SELECT * FROM `current` ORDER BY unix_timestamp(STR_TO_DATE(`log`, '%Y-%m-%d %h:%i-%s')) DESC LIMIT 1";
- $result = mysql_query($sql);
- if (!$result) {
- die('Invalid query: ' . mysql_error());
- }
- $row = mysql_fetch_array($result)
- if($row[1] == '0')
- {
- $to = "siddharth16871687@gmail.com";
- $sub = "CURRENT REACHED 0";
- $mail = '
- <html>
- <head>
- <title>tasrfew</title>
- </head>
- <body>
- Yo niga yo request has been accepted, ok
- </body>
- </html>
- ';
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- $headers .= 'From: gmail <siddharth16871687@gmail.com>' . "\r\n";
- mail($to, $sub, $mail, $headers);
- echo "EMAIL SENT";
- }
- mysql_close($conn);
- ?>
Add Comment
Please, Sign In to add comment