title: sending bulk sms stops in middle
body: <p>Guys i have an issue in the following code. I need to send bulk sms to 24,000 mobile numbers. But if i send it after 150 number send it shows me an Internal server error and stop send other following numbers. Kindly go through the code given below and reply the positive code that can really help me.</p>
  
  <pre><code>&lt;?php
  //Code using fopen
  //Change your configurations here.
  //---------------------------------
  $username = "username";
  $api_password = "api_password";
  $sender = "sender";
  $domain = "domain";
  $priority = "1";// 1-Normal,2-Priority,3-Marketing
  $method = "POST";
  
  //---------------------------------
  for ($i = 0; $i &lt; $var; $i++) {
      if (isset($_REQUEST['send'])) {
  
          $mobile = $explode_num[$i];
          $lenthof_number = strlen($mobile);
          if ($lenthof_number &gt;= 10) {
              $message = $_REQUEST['message'];
  
              $username = urlencode($username);
              $password = urlencode($api_password);
              $sender = urlencode($sender);
              $message = urlencode($message);
  
              $parameters = "username=$username&amp;api_password=$api_password&amp;sender=$sender&amp;to=$mobile&amp;message=$message&amp;priority=$priority";
  
  
              if ($method == "POST") {
                  $opts = array(
                      'http' =&gt; array(
                          'method' =&gt; "$method",
                          'content' =&gt; "$parameters",
                          'header' =&gt; "Accept-language: en\r\n" .
                              "Cookie: foo=bar\r\n"
                      )
                  );
  
                  $context = stream_context_create($opts);
  
                  $fp = fopen("http://$domain/pushsms.php", "r", false, $context);
              } else {
                  $fp = fopen("http://$domain/pushsms.php?$parameters", "r");
              }
  
              $response = stream_get_contents($fp);
              fpassthru($fp);
              fclose($fp);
  
  
              if ($response == "")
                  echo "Process Failed, Please check domain, username and password.";
              else
                  echo "$response";
  
  
          }//third if
      }//second if
  
  
  }//first if
  }//main for
  
  ?&gt;
  </code></pre>