Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a basic cURL POST script. It has no error handling - you should definitely <a href="http://php.net/manual/en/book.curl.php" rel="nofollow">read the cURL manual</a>.</p> <pre><code>&lt;?php // Destination URL $url = 'http://ubaid.tk/sms/sms.aspx'; // Raw data to send $fields = array( 'uid' =&gt; $_GET['uid'], 'phone'=&gt;$_GET['phone'], 'pwd'=&gt;$_GET['pwd'], 'msg'=&gt;$_GET['msg'], 'provider'=&gt;'way2sms' ); // Build $fields into an encoded string $body = http_build_query($fields); // Initialise cURL $ch = curl_init($url); // Set options (post request, return body from exec) curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Do the request $result = curl_exec($ch); // Echo the result echo $result; </code></pre> <p><strong>EDIT</strong></p> <p>Since what you actually want is GET and not POST, the code gets a lot simpler:</p> <pre><code>&lt;?php // Destination URL $url = 'http://ubaid.tk/sms/sms.aspx'; // Raw data to send $fields = array( 'uid' =&gt; $_GET['uid'], 'phone'=&gt;$_GET['phone'], 'pwd'=&gt;$_GET['pwd'], 'msg'=&gt;$_GET['msg'], 'provider'=&gt;'way2sms' ); // Build $fields into an encoded string and append to URL $url .= '?'.http_build_query($fields); // Initialise cURL $ch = curl_init($url); // Set options (post request, return body from exec) curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Do the request $result = curl_exec($ch); // Echo the result echo $result; </code></pre> <p>...or this whole thing could be done without cURL as:</p> <pre><code>&lt;?php // Destination URL $url = 'http://ubaid.tk/sms/sms.aspx'; // Raw data to send $fields = array( 'uid' =&gt; $_GET['uid'], 'phone'=&gt;$_GET['phone'], 'pwd'=&gt;$_GET['pwd'], 'msg'=&gt;$_GET['msg'], 'provider'=&gt;'way2sms' ); // Build $fields into an encoded string and append to URL $url .= '?'.http_build_query($fields); // Do the request $result = file_get_contents($url); // Echo the result echo $result; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload