title: php curl throwing 500 error
body: <p>The curl is giving me 500 error. How to fix 500 error ?</p>
  
  <pre><code>$msg='Phone:'.$_POST['phone'].',Email:'.$_POST['email'].',Message:'.$_POST['query'].''; // This is dynamic msg.  
  $urlpara="http://xxx.xxx.xxx.xx:8080/sendsms/bulksms?username=xxx&amp;password=xxxx&amp;type=0&amp;dlr=1&amp;destination=xxxx&amp;source=xxxx&amp;message=".$msg."";    
  $response = sentSmS($urlpara);
  
  if($response){
      header('Location: thankyou.html');  
      exit;
  }else{
      header('Location: thankyou.html');  
      exit;
  }
  
  function sentSmS($url) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_HEADER, 0);
      curl_exec($ch);
      return true;
  }   
  </code></pre>