Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This should do the trick... but you should also add in some sanitization on your inputs to help protect against the possibility of injection (this is an entirely different discussion).</p> <p>Sending Via GET</p> <pre><code>&lt;?php $connection_url = sprintf('http://example/sms/sms.aspx?uid=814974&amp;pwd=pass&amp;msg=%s&amp;phone=%s&amp;provider=way2sms', $_REQUEST['message'], $_REQUEST['mobileno.']); $ch = curl_init($connection_url); curl_setopt($ch, CURLOPT_HTTPGET, 1); // Make sure GET method it used curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Return the result curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); $data = curl_exec($ch); // Run the request // Display the result echo "&lt;pre&gt;"; print_r($data); /* result of SMS API call*/ echo '&lt;/pre&gt;'; ?&gt; </code></pre> <p>Sending Via POST</p> <pre><code>&lt;?php // Setup Connection URL $connection_url = sprintf('http://example/sms/sms.aspx'); // Setup Post Variables $post_vars = sprintf('uid=814974&amp;pwd=pass&amp;msg=%s&amp;phone=%s&amp;provider=way2sms', $_REQUEST['message'], $_REQUEST['mobileno.']); $ch = curl_init($connection_url); curl_setopt($ch, CURLOPT_POST, 1); // Make sure POST method it used curl_setopt($ch,CURLOPT_POSTFIELDS, $post_vars); // Attach post variables curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Return the result curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); $data = curl_exec($ch); // Run the request // Display the result echo "&lt;pre&gt;"; print_r($data); /* result of SMS API call*/ echo '&lt;/pre&gt;'; ?&gt; </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.
    3. 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