Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "check sms sending time - type your phone number here";
- echo "<form action='' method='post'>
- <input type='to'>
- <input type='submit'>
- </form>";
- if (isset($_POST['to']))
- {
- $to = $_POST['to'];
- $time_start = microtime(true);
- date_default_timezone_set("Asia/Dhaka");
- $date = date("l jS \of F Y h:i:s A");
- $server = "http://api.greenweb.com.bd/api.php?token=yourtokenhere&message=ok&to=$to";
- function checkOnline($domain) {
- $curlInit = curl_init($domain);
- curl_setopt($curlInit, CURLOPT_ENCODING, '');
- curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10);
- curl_setopt($curlInit, CURLOPT_NOBODY, true);
- curl_setopt($curlInit, CURLOPT_HEADER, true);
- curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($curlInit, CURLOPT_VERBOSE,true);
- curl_setopt($curlInit, CURLOPT_FORBID_REUSE, 1);
- curl_setopt($curlInit, CURLOPT_HTTPHEADER, array('Connection: Close'));
- $response = curl_exec($curlInit);
- if(curl_errno($curlInit))
- {
- echo 'Curl error: ' . curl_error($curlInit);
- }
- curl_close($curlInit);
- if ($response) return true;
- return false;
- }
- echo checkOnline("$server");
- $time_end = microtime(true);
- //dividing with 60 will give the execution time in minutes otherwise seconds
- $execution_time = ($time_end - $time_start);
- //execution time of the script
- echo "time $execution_time </br>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement