title: posting name value pairs to an URL using curl
body: <p>I have signed up with a web based short messaging service to send text messages to confirm webform submissions. I am using CURL and my PHP code is as follows </p>
  
  <pre><code>$url = "http://www.mysmservice.co.uk/smsgateway/sendmsg.aspx?";
  $param = "username=" . $username . "&amp;password=" . $password . "&amp;to=" . $diner_mobile . "&amp;text=";
  $smsmessage = "Hello, your table booking for " . $bookingdate . " at " . $booking_time . " is confirmed " , " Myrestaurant";
  
  $ch = curl_init() or die(curl_error()); 
  curl_setopt($ch, CURLOPT_POST,1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS,$param); 
  curl_setopt($ch, CURLOPT_PORT, 80);
  curl_setopt($ch, CURLOPT_URL,$url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  $data1=curl_exec($ch) or die(curl_error());
  curl_close($ch); 
  </code></pre>
  
  <p>But it doesn't seem to be posting anything to the URL (mysmsservice tells me that the logs don't indicate any incoming requests). However the service work if I visit the following URL and replace the appropriate variables.</p>
  
  <p><a href="http://www.mysmsservice.co.uk/smsgateway/sendmsg.aspx?username=MyUsername" rel="nofollow">http://www.mysmsservice.co.uk/smsgateway/sendmsg.aspx?username=MyUsername</a> &amp;password=MyPassword&amp;to=44771012345,44771054321&amp;text=TheMessage</p>
  
  <p>Not sure if I am using the CURL calls properly. Any help will be appreciated. Thanks in advance.</p>