Skip to content

Instantly share code, notes, and snippets.

@pswincom-examples
Created December 13, 2013 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pswincom-examples/7941554 to your computer and use it in GitHub Desktop.
Save pswincom-examples/7941554 to your computer and use it in GitHub Desktop.
Simple example for php
<?php
$url = "http://sms3.pswin.com/sms";
$doc = <<<XML
<?xml version="1.0"?>
<SESSION>
<CLIENT>myusername</CLIENT>
<PW>mypassword</PW>
<MSGLST>
<MSG>
<TEXT>Test message</TEXT>
<RCV>4799999999</RCV>
</MSG>
</MSGLST>
</SESSION>
XML;
$params = array('http' => array(
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . strlen($doc) . "\r\n",
'content' => $doc
));
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
$response = @stream_get_contents($fp);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment