Php sends the sms instance code

Source: Internet
Author: User

<Html>
<Head>
<Title> SMS Web Sender Demo </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = iso-8859-1">
</Head>

<Body bgcolor = "# FFFFFF" text = "#000000">
<H2> SMS Web Sender DEMO! </H2>

<? Php
If ($ action! = "Submit "){
?>

<I> Any username or password you enter here will not be stored
In any way (although we're not using SSL either) </I>

<P> <I> Also, as you can see most of these are UK sites, not all
Of them will support international numbers! </I> </p>

<Form method = "post" action = "demo. php">
<Table width = "600" border = "0" cellspacing = "0" cellpadding = "4">
<Tr>
<Td align = "right"> <B> Site </B> </td>
<Td>
<Select name = "site">
<Option value = "txtuk.net"> txtuk.net (no login) </option>
<Option value = "mtnsms_com"> mtnsms.com </option>
<Option value = "lycos_co_uk"> lycos. co. uk </option>
<Option value = "excite_co_uk"> excite. co. uk </option>
<Option value = "uboot_com"> uboot.com </option>
<Option value = "genie_co_uk"> genie. co. uk </option>
</Select>
</Td>
</Tr>
<Tr>
<Td align = "right"> <B> User </B> </td>
<Td>
<Input type = "text" name = "user">
</Td>
</Tr>
<Tr>
<Td align = "right"> <B> Password </B> </td>
<Td>
<Input type = "password" name = "pass">
</Td>
</Tr>
<Tr>
<Td valign = "top" align = "right"> <B> Number </B> </td>
<Td>
<Input type = "text" name = "number">
(Eg. + 447123123123) </td>
</Tr>
<Tr>
<Td valign = "top" align = "right"> <B> Message </B> </td>
<Td>
<Textarea name = "message" cols = "40" rows = "8"> </textarea>
</Td>
</Tr>
<Tr>
<Td align = "right"> <B> Debug </B> </td>
<Td>
<Input type = "checkbox" name = "debug" value = "yes">
</Td>
</Tr>
<Tr>
<Td align = "right"> & nbsp; </td>
<Td> & nbsp; </td>
</Tr>
<Tr>
<Td align = "right"> & nbsp; </td>
<Td>
<Input type = "hidden" name = "action" value = "submit">
<Input type = "submit" name = "Submit" value = "Send! ">
</Td>
</Tr>
</Table>
</Form>

<? Php

} Else {

// Contains the site details
Include ("sites. php ");

// Contains main class
Include ("class. sms_web_sender.php ");

If (empty ($ number) | empty ($ site) | empty ($ message )){
Die ("Make sure number, site and message are not empty ");
 }

If (! Empty ($ debug) & $ debug = "yes "){
$ Debug = true;
} Else {
$ Debug = false;
 }

// Signature bit of text that's required by some
// Sites like MTNSMS.com, you can leave as is
$ Signature = "*";

// Create instance of sms web sender the one
// Optional argument will determine if
// Debug is turned on or not
$ Sms = new sms_web_sender ($ debug );

// Add accounts
// 1st argument: username
// 2nd argument: password
// 3rd argument: server
// 4th argument: weight (this is only useful when
// Shuffling the logins, the higher
// The weight, the more likely it'll
// Be placed near the top of the list)
// Default if left blank: 1
$ Sms-> add_login ("$ user", "$ pass", "$ site ");

// Add Proxy Server details if required
// I haven'ttested this myself, feature of jm_sms
// $ Sms-> setProxyServer ("proxyserver ");
// $ Sms-> setProxyPort (81 );
// $ Sms-> setProxyUser ("proxyusername ");
// $ Sms-> setProxyPass ("proxypassword ");
// $ Sms-> setProxy (true );

// Passes the number, signature and message in an array
$ Result = $ sms-> send_sms (array ("number" => $ number, "signature" => $ signature, "message" => $ message ));

If ($ result ){
Echo "} Else {
Echo "Echo "<p> <a href =" javascript: history. back () "> Go Back </a> </p> ";
 }

}

?>

</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.