title: Simple GET request with PHP cURL to send SMS text message
body: <p>I'm creating quick web app that needs to send a php-created message from within php code.  cURL is apparently the tool for the job, but I'm having difficulty understanding it enough to get it working.</p>
  
  <p>The documentation for the API I'm dealing with is <a href="http://wiki.cdyne.com/index.php/SMS_Notify!" rel="nofollow">here</a>.  In particular I want to use the simple GET-based sms notification documented <a href="http://sms2.cdyne.com/sms.svc/help/operations/SimpleSMSsend" rel="nofollow">here</a>.  The latter resource states that the GET API is simply:</p>
  
  <pre><code>http://sms2.cdyne.com/sms.svc/SimpleSMSsend?PhoneNumber={PHONENUMBER}&amp;Message={MESSAGE}&amp;LicenseKey={LICENSEKEY}
  </code></pre>
  
  <p>And indeed, if I type the following URL into a browser, I get the expected results:</p>
  
  <pre><code>http://sms2.cdyne.com/sms.svc/SimpleSMSsend?PhoneNumber=15362364325&amp;Message=mymessage&amp;LicenseKey=2134234882347139482314987123487
  </code></pre>
  
  <p>I am now trying to create the same affect within php.  Here is my attempt:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;?php
  $num = '13634859126';
  $message = 'some swanky test message';
  
  $ch=curl_init();
  curl_setopt($ch, CURLOPT_URL, "http://sms2.cdyne.com/sms.svc/SimpleSMSsend?PhoneNumber=".urlencode($num)."&amp;Message=".urlencode($message)."&amp;LicenseKey=2345987342583745349872");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_exec($ch);
  curl_close($ch);
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My other PHP webpages work fine, so I know php and apache are all set up correctly.  But When I point my browser at the above page, I get no message on my phone.  Can anybody show me what I'm doing wrong?</p>
  
  <p><em>Note: all numbers are faked... as you might have suspected.</em></p>