johnmahugu

snpp-sms

May 25th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.64 KB | None | 0 0
  1. <?php
  2.   $strResult = "n/a";
  3.   $strLastResponse = "";
  4.  
  5.   $objSnpp = new COM("AxSms.Snpp");
  6.   $objSnpp->LogFile = sys_get_temp_dir()."Snpp.log";
  7.   // Windows default: 'C:\Windows\Temp\Snpp.log'
  8.  
  9.   // Form submitted
  10.   if (isset($_POST["btnSendMessage"]))
  11.   {  
  12.     $objSnpp->Clear();
  13.     $objSnpp->Server = $_POST["ddlServers"];
  14.     $objSnpp->ServerPort = $_POST["txtPort"];
  15.     $objSnpp->ServerTimeout = 2000;
  16.        
  17.     $objSnpp->Send($_POST["txtPagerID"], $_POST["txtMessage"]);
  18.    
  19.     $strResult = $objSnpp->LastError . ": " . $objSnpp->GetErrorDescription($objSnpp->LastError);
  20.     $strLastResponse = $objSnpp->ProviderResponse;
  21.   }
  22.  
  23. // HTML-CSS layout includes, no code there!
  24. include('css/Header.html');
  25. include('css/Menu.html');
  26. ?>
  27.     <div class="container">
  28.       <h1>SMS Component PHP Pager SNPP Sample</h1>
  29.       <hr />
  30.       <p>
  31.         SNPP stands for Simple Network Pager Protocol. This protocol is most used in the U.S. to send messages to pagers.
  32.       </p>
  33.       <form action="pagersnpp.php" method="post">
  34.         <h2>SMS Component:</h2>
  35.         <h3>Build: <?php echo $objSnpp->Build; ?>; Module: <?php echo $objSnpp->Module; ?></h3>
  36.        
  37.         <!-- Server -->
  38.         <label for="Server">Server:</label>
  39.         <p>
  40.           <select id="Server" name="ddlServers">
  41.             <option value="snpp.myairmail.com">snpp.myairmail.com</option>
  42.             <option value="snpp.pageallcom.com" selected="true">snpp.pageallcom.com</option>
  43.             <option value="snpp.americanmessaging.net">snpp.americanmessaging.net</option>
  44.             <option value="snpp.attws.net">snpp.attws.net</option>
  45.             <option value="pmcl.net">pmcl.net</option>
  46.             <option value="page.contactwireless.com">page.contactwireless.com</option>
  47.             <option value="www.webpager.us">www.webpager.us</option>
  48.             <option value="epage.graylink.com">epage.graylink.com</option>
  49.             <option value="alphapage.cc">alphapage.cc</option>
  50.             <option value="mail2.illinoissignal.net">mail2.illinoissignal.net</option>
  51.             <option value="ipnpaging.com">ipnpaging.com</option>
  52.             <option value="snpp.lauttamus.com">snpp.lauttamus.com</option>
  53.             <option value="snpp.mobilcom.net">snpp.mobilcom.net</option>
  54.             <option value="pecos.nextel.com">pecos.nextel.com</option>
  55.             <option value="snpp.nextel.com">snpp.nextel.com</option>
  56.             <option value="snpp.ucom.com">snpp.ucom.com</option>
  57.             <option value="mail.pagerpeople.com">mail.pagerpeople.com</option>
  58.             <option value="snpp.sbc.com">snpp.sbc.com</option>
  59.             <option value="snpp.acswireless.com">snpp.acswireless.com</option>
  60.           </select>
  61.           For a list of recommended SNPP providers. <a href="http://www.activexperts.com/xmstoolkit/snpplist/" target="_blank">Click here</a>
  62.         </p>
  63.        
  64.         <!-- Port -->
  65.         <label for="Port">Port:</label>
  66.         <p>
  67.           <input type="text" id="Port" name="txtPort" value="444" />
  68.         </p>
  69.        
  70.         <!-- Empty row -->
  71.         <div class="clearRow"></div>
  72.        
  73.         <!-- PagerID -->
  74.         <label for="PagerID">PagerID:</label>
  75.         <p>
  76.           <input type="text" id="PagerID" name="txtPagerID" value="[PagerID]" />
  77.           Note: Most providers require a 10 digit page number.
  78.         </p>
  79.        
  80.         <!-- Message -->
  81.         <label for="Message">Message:</label>
  82.         <p>
  83.           <textarea id="Message" name="txtMessage" style="height:45px;">[Message]</textarea>
  84.         </p>
  85.        
  86.         <!-- Send button -->
  87.         <div class="clearLabel"></div>
  88.         <p>
  89.           <input type="submit" name="btnSendMessage" value="Send Message" />
  90.         </p>
  91.        
  92.         <!-- Empty row -->
  93.         <div class="clearRow"></div>
  94.        
  95.         <!-- Result -->
  96.         <label for="Result"><b>Result:</b></label>  
  97.         <p>
  98.           <input type="text" id="Result" name="txtResult" class="FullWidth Bold" value="<?php echo $strResult; ?>" />
  99.         </p>
  100.        
  101.         <!-- Last Response -->
  102.         <label for="Response">Last Response:</label>
  103.         <p>
  104.           <input type="text" id="Response" name="txtLastResponse" class="FullWidth" value="<?php echo $strLastResponse; ?>" />
  105.         </p>
  106.       </form>
  107.       <p>
  108.         This demo uses the ActiveXperts SMS Component, an <a href="http://www.activexperts.com" target="_blank">ActiveXperts Software</a> product.<br />
  109.         <a href="index.php">Back to main page</a>
  110.       </p>
  111.     </div><!-- /container -->
  112. <?php
  113. //HTML-CSS layout include, no code there!
  114. include('css/Footer.html'); ?>
Add Comment
Please, Sign In to add comment