Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(855);
- $con = mysqli_connect('localhost','nadeem00_toplist','nestle123456','nadeem00_toplist');
- //$con = mysqli_connect('localhost','root','','topfive');
- function send_sms(){
- global $con;
- $username = 923155700444;
- $password = 2781;
- $From = 'Toplist.pk';
- $sql = "SELECT * FROM sms WHERE status =0 order by id ASC";
- $query = mysqli_query($con,$sql);
- if (!$query) {
- echo 'MySQL Error: ' . mysqli_error();
- }
- $rowcount=mysqli_num_rows($query);
- if($rowcount > 0){
- while($row = mysqli_fetch_assoc($query)){
- $msg = urlencode($row['message']);
- $number = $row['number'];
- $id = $row['id'];
- $api =("http://sendpk.com/api/sms.php?username=$username&password=$password&sender=$From&mobile=$number&message=$msg");
- $response = file_get_contents($api);
- $res = explode(' ', $response , 2);
- if(trim($res[0]) == 'OK'){
- $status =1;
- } else {
- $status =2;
- }
- $sql = "UPDATE sms SET status='$status' WHERE id='$id'";
- $query = mysqli_query($con,$sql);
- }
- }
- }
- $starttime = microtime(true);
- for ($i=0; $i<=111; $i++){
- $now = microtime(true) -$starttime;
- if ($now > 892) {
- break;
- }
- send_sms();
- sleep(8);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement