Sending SMS messages
Moderator: General Moderators
Sending SMS messages
I was wondering how we could integrate PHP and SMS to send text messages to a specified phone number. Should I go through Sprint's "Developer program"?
A few sites have done the same thing... Example: http://www.send-a-text.net/
Any ideas?
A few sites have done the same thing... Example: http://www.send-a-text.net/
Any ideas?
I've whipped up a small php file that will allow the user to send text messages of 130 chars or less, to the desired phone number, and desired service.
Source:
Edit: Updated service list
Source:
Code: Select all
<html>
<body>
<font style=font-family:Verdana;font-size:12px;color:000000;>
<?
if ($_POST["action"] == "send") {
// Sort through services
switch($_POST["service"]) {
case 'att':
$service = "mobile.att.net";
break;
case 'cingular':
$service = "mycingular.com";
break;
case 'nextel':
$service = "messaging.nextel.com";
break;
case 'qwest':
$service = "qwestp.com";
break;
case 'sprintpcs':
$service = "messaging.sprintpcs.com";
break;
case 't-mobile':
$service = "tmomail.net";
break;
case 'verizon':
$service = "vtext.com";
break;
case 'voicestream':
$service = "voicestream.net";
break;
}
// Trim up a few variables
$number = str_replace("(", "", $_POST["number"]);
$number = str_replace(")", "", $number);
$number = str_replace("-", "", $number);
$number = str_replace(" ", "", $number);
$number = eregi_replace("^[a-zA-Z]$", "", $number);
$smsto = $number . "@" . $service;
if (strlen($message) > 130) {
echo "Message is too long. Try keeping the message under/exactly 130 characters.<p>\n\n";
} else {
mail($smsto, $subject, $message, "From: The xSMS service") or die("Unable to send your message. Please try again later.");
// Record information into MySQL Database
$time = time();
@mysql_connect("localhost", "user", "pass");
@mysql_select_db("php");
mysql_query("INSERT INTO sms_messages (`number`,`service`,`email`,`message`,`time`) VALUES ('{$_POST["number"]}','{$_POST["service"]}','$smsto','{$_POST["message"]}','$time')");
echo "Your message has been sent.<p>\n\n";
}
}
?>
<form method="POST" align=center action=<? echo $PHP_SELF; ?>>
<input type=hidden name=action value=send>
<table border=0 cellspacing=2 cellpadding=0 style=font-family:Verdana;font-size:12px;color:000000;>
<tr><td><b>Message:</b></td><td valign="top"><textarea name=message rows=5 cols=18 wrap=no style=font-family:Verdana;font-size:12px;color:000000;></textarea></td></tr>
<tr><td><b>Number:</b></td><td valign="top" align=left><input type="text" name=number style=font-family:Verdana;font-size:12px;color:000000; size=19></td></tr>
<tr><td><b>Service:</b></td><td valign="top" align=left><select name=service style=font-family:Verdana;font-size:12px;color:000000;><option value="att">AT&T Wireless<option value="cingular">Cingular<option value="nextel">Nextel<option value="qwest">Qwest Wireless<option value="sprintpcs">Sprint PCS<option value="t-mobile">T-Mobile<option value="verizon">Verizon<option value="voicestream">VoiceStream</select></td></tr>
<tr><td valign="top" align=left></td><td valign="top" align=left><INPUT TYPE="submit" width=84 height=15 border=0 value="Send Message" style=font-family:Verdana;font-size:12px;color:000000;></td></tr>
</table>
</form>
</font>
</body>
</html>Very nice. I was just thinking send some variables to the local sites:
http://www.rogers.com/english/wireless/sendpcs.html
http://www.telusmobility.com/sendamessa ... sage.shtml
http://www.fido.ca/portal/home/quickMsg.jsp?lang=en
This is much easier. hmmm now i wonder how i can find out the exact service address for these...
http://www.rogers.com/english/wireless/sendpcs.html
http://www.telusmobility.com/sendamessa ... sage.shtml
http://www.fido.ca/portal/home/quickMsg.jsp?lang=en
There must be a list somewhere with area codes and first 3 letters of the 7 letter number that will determine it's service.
Anyway, I plan on making a little community type service for cell users, so they can login with their number + password (setup when registered their phone with my community), keep "buddies" (will set up a phonebook, listed by a nickname, so it's even easier to send SMS messages to your friends), history of your sent messages, etc...
What a good Weekend project.
Anyway, I plan on making a little community type service for cell users, so they can login with their number + password (setup when registered their phone with my community), keep "buddies" (will set up a phonebook, listed by a nickname, so it's even easier to send SMS messages to your friends), history of your sent messages, etc...
What a good Weekend project.
good example: http://www.textamerica.com/
btw; here is the addresses of a few canadian providers:
10_digit_phone_number@pcs.rogers.com
10_digit_phone_number@msg.telus.com
10_digit_phone_number@fido.ca
10_digit_phone_number@txt.bellmobility.ca
and here is a list of suposedly 95% of all sms enabled providers in north america:
A simple google search for anyone of thoses can find the address for sms'ing a subscriber of their service.
btw; here is the addresses of a few canadian providers:
10_digit_phone_number@pcs.rogers.com
10_digit_phone_number@msg.telus.com
10_digit_phone_number@fido.ca
10_digit_phone_number@txt.bellmobility.ca
and here is a list of suposedly 95% of all sms enabled providers in north america:
It's a good list to have if you want to offer messeges to every provider imaginable.http://www.charlwood.com/BirdSMS/coverage.htm wrote:Canada
Amcal
Bell Mobility CDMA
Mobility
British Columbia Tel.
Clearnet MIKE
Clearnet PCS CDMA
Fido/Microcell GSM
Maritime AT&T CDMA
Pagenet Canada Paging
Rogers AT&T Available
Shawn
Rogers Communications
Telus Mobility
CDMA l
United States
USA/3RIVERS WIRELESS
USA/5STAR WIRELESS
USA/A BETTER BEEP
USA/ACS Wireless
USA/ADVANCED SUPERIOR PAGING
USA/AERIAL COMMUNICATIONS
USA/AIRADIGM COMMUNICATIONS INC
USA/AIRNOTE
USA/AIRPAGE
USA/AIRTOUCH
USA/ALABAMA CELLULAR SERVICE, INC.
USA/ALBANY TELEPHONE COMPANY DBA CELLULAR ONE
USA/ALEXANDRA CELLULAR
USA/ALIANT COMMUNICATIONS
USA/ALLTEL MOBILE COMMUNICATIONS, INC.
USA/AMARILLO CELLTELCO DBA CELLULAR ONE
USA/AMCALL PAGING (TORONTO)
USA/AMCALL PAGING (VANCOUVER)
USA/AMERIPAGE
USA/AMERITECH CELLULAR SERVICES
USA/AMERITECH MOBILE COMMUNICATIONS, INC.
USA/AMERITECH PAGING
USA/AMICA WIRELESS
USA/AQUIS COMMUNICATIONS
USA/ARCH COMMUNICATIONS
USA/ATT
USA/BAY STAR
USA/BEEPER EXPRESS
USA/BEEPWEAR
USA/BELL ATLANTIC
USA/BELL MOBILITY
USA/BELL MOBILITY PAGING
USA/BELL SOUTH
USA/BELLSOUTH WIRELESS
USA/BLUEGRASS CELLULAR
USA/BRITISH COLUMBIA TEL
USA/BUFFALO TELEPHONE COMPANY DBA CELLULAR ONE
USA/CAROLINA PCS 1 LIMITED PARTNERSHIP
USA/CAYMAN ISLAND PAGING
USA/CELLCOM
USA/CELLULAR MOBILE SYSTEMS OF ST. CLOUD
USA/CELLULAR ONE (Boston)
USA/CELLULAR PARTNERS OF LAMAR
USA/CELLULAR XL ASSOCIATES
USA/CELPAGE
USA/CENTENNIAL WIRELESS OF PUERTO RICO
USA/CENTRAL WIRELESS
USA/CHILLICOTHE TELEPHONE
USA/CINCINNATI BELL
USA/CINGULAR WIRELESS
USA/COLEMAN COUNTY TELEPHONE
USA/COMMUNICATIONS VENTURE CORP DBA INDIGITAL TELECOM
USA/CONCORD TEL CO
USA/CONESTOGA WIRELESS
USA/CONTACT PAGING
USA/COOK TELECOM, INC.
USA/CROSS TELEPHONE CO
USA/CUE PAGING
USA/DIGIPH PCS, INC.
USA/DOBSON CELLULAR SYSTEMS, INC.
USA/EINSTEIN PCS
USA/EL DORADO CELLULAR
USA/E-PAGEME
USA/FIDO/MICROCELL
USA/FIRST CELLULAR
USA/FLORIDA CELLULAR SERVICE, INC.
USA/FRONTIER CELLULAR
USA/FUNMAIL
USA/GABRIEL WIRELESS
USA/GALVESTON CELLULAR ONE
USA/GRANITE STATE TELEPHONE
USA/GREAT LAKES OF IOWA, INC. DBA CELLULAR ONE
USA/GTE MOBILNET
USA/GTE Pacifica
USA/GTE WIRLESS
USA/HARGRAY COMMUNICATIONS
USA/HIGH PLAINS MIDWEST, LLC
USA/HORIZON PCS
USA/HOUSTON CELLULAR
USA/HUTCHINSON TELEPHONE
USA/INDUSTAR
USA/INTELOS
USA/INTERPAGE COMMUNICATIONS
USA/IOWA WIRELESS
USA/ISLAND PAGE INC
USA/JSM COMMUNICATION
USA/KERRVILLE TEL CO
USA/LA CELLULAR
USA/LCS PAGING
USA/MAGNACOM WIRELESS
USA/MAINE WIRELESS
USA/MAP MOBILE COMMUNICATIONS, INC.
USA/MARITIME TT
USA/MATANUSKA KENAI DBA CELLULAR
USA/MCI (PIN only)
USA/MCI CELL (Cell numbers)
USA/MCI One Way PAGING
USA/MCI Two Way
USA/MEMPHIS CELL TEL CO.
USA/MESSAGE EXPRESS COMPANY
USA/METRO BEEPER
USA/METROCALL
USA/MIDWEST WIRELESS
USA/MINNCOMM
USA/MINNESOTA SOUTHERN WIRELESS
USA/MOBILE PARTNERS CORPORATION
USA/MOBILE RADIO COMMUNICATIONS
USA/MOBILECOMM
USA/MOBILETEL
USA/MOBILFONE
USA/MOBITEL
USA/NATIONAL MOBILE COMMUNICATIONS CORPORATION
USA/NETINFORMER
USA/NEVADA BELL
USA/NEWPAR DBA AIRTOUCH CELLULAR
USA/NEXTEL
USA/NPI WIRELESS (10 DIGIT PHONENO)
USA/OMNIPOINT
USA/ONE2ONE
USA/ORBLINK
USA/PACIFIC BELL
USA/PACIFIC BELL MOBILE SERVICES
USA/PACIFIC BELL WIRELESS
USA/PAGE TELECOMMUNICATIONS
USA/PAGEMART
USA/PAGENET (U.S.)
USA/PAGENET CANADA
USA/PANHANDLE TELECOMMUNICATIONS SYSTEMS, INC.
USA/PCS ONE
USA/PENSELL COMMUNICATIONS
USA/PINPOINT Wireless
USA/PIONEER CELLULAR
USA/POKA LAMBRO PCS
USA/POWERTEL
USA/PRIMECO
USA/PRIORITY COMMUNICATIONS
USA/PROPAGE
USA/RADIOCOMM PAGING
USA/RADIOFONE - 10 DIGIT PHONENO
USA/ROGERS ATT
USA/ROGERS COMMUNICATION
USA/SALISBURY MOBILE TELEPHONE INC
USA/SCHUYLKILL MOBILE FONE, INC.
USA/SHAWPAGING
USA/SHENANDOAH MOBILE COMPANY
USA/SKYTEL
USA/SKYTELPLUS
USA/SMARTBEEP
USA/SOUTHERN LINC
USA/SOUTHWESTERN BELL
USA/SPRINT
USA/STPCS JOINT VENTURE
USA/SUNCOM
USA/SUSSEX CELLULAR
USA/SWB MOBILE SYSTEMS
USA/TCI COMMUNICATIONS
USA/TELETOUCH
USA/TELUS MOBILITY
USA/THIRD KENTUCKY CELLULAR CORP.
USA/TIMNET
USA/TRIAD CELLULAR
USA/TRITON
USA/TSR
USA/UBET WIRELESS
USA/UNION TELEPHONE COMPANY DBA UNION CELLULAR
USA/UNITY COMMUNICATIONS
USA/UPSTATE CELLULAR NETWORK
USA/US CELLULAR
USA/US UNWIRED
USA/US WEST
USA/VERIZON WIRELESS
USA/VIA WIRELESS
USA/VIRGINIA CELLULAR
USA/VIRGINIA PCS ALLIANCE
USA/VOICE STREAM
USA/WASHINGTON/BALTIMORE CELLULAR LIMITED
USA/WEST COAST PCS
USA/WESTERN COMMUNICATIONS
USA/WESTERN PAGING
USA/WINSTAR WIRELESS, INC.
USA/WIRELESS ALLIANCE
USA/WORDME.COM
Re: nice idea
SMS are sent like email, so it's pretty much impossible to display on a page.irealms wrote:when people didn't have net access they could still send messages to the site that people could read.
But it is good for an 'Instant Alert' service you could provide where your web site members/visitors can receive information from you.
Re: nice idea
Hi - I'm new here and was just looking around when I noticed this post.irealms wrote:i was wondering if it's possible to send a sms and have this message appear on a php page?
when people didn't have net access they could still send messages to the site that people could read.
We developed this script a while ago and are in the process of making an interface that allows them to be setup by anyone for there own site.
http://www.toastedmedia.net/txt2site/test.php?cam_id=83
Test it by sending a message to it. This page was only configured about 10 mins ago and needs something interesting on it !!
If you want a page like this email me. We can also pass the sms to your server as an http post or an email as well.
See ya
Phil
a stupid question .. ><
I think I should apologize for this stupid question first
,
I'm a newbie in working wif PHP,
i can't even open a php file,
how can i open it??
just direct double click it??
i did so but source code of that page showed,
i tried enable the IIS and open it at client site also get the same result,
what's wrong?
I'm a newbie in working wif PHP,
i can't even open a php file,
how can i open it??
just direct double click it??
i did so but source code of that page showed,
i tried enable the IIS and open it at client site also get the same result,
what's wrong?

Canada
United States