PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 17, 2017 6:20 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Sending SMS messages
PostPosted: Sun Mar 30, 2003 9:35 pm 
Offline
Moderator
User avatar

Joined: Sat Apr 20, 2002 3:14 pm
Posts: 1416
Location: Dallas, TX
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?

_________________
Image Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2003 12:30 am 
Offline
Moderator
User avatar

Joined: Sat Apr 20, 2002 3:14 pm
Posts: 1416
Location: Dallas, TX
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:

Syntax: [ Download ] [ Hide ]
<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>


Edit: Updated service list

_________________
Image Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2003 7:27 pm 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
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...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2003 9:20 pm 
Offline
Moderator
User avatar

Joined: Sat Apr 20, 2002 3:14 pm
Posts: 1416
Location: Dallas, TX
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. :)

_________________
Image Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2003 7:09 pm 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
sounds more like a source forge project to me =P

Need any help? :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2003 8:17 pm 
Offline
Moderator
User avatar

Joined: Sat Apr 20, 2002 3:14 pm
Posts: 1416
Location: Dallas, TX
You could take over the project for a few weeks if you would like. :) I've got a deadline set for my commercial website, and I've only got 2 weeks to get it done! 8O

Need any ideas? Contact me :)

_________________
Image Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2003 12:13 am 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
Sounds good. :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2003 10:57 pm 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
I've started development on a very simple version based on this.

Working very nice with my new phone. 8) I might go as far as creating some sort of web based service like some others have.

They are racking up the dollars charging per thousand messeges or so. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2003 11:11 pm 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
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:

http://www.charlwood.com/BirdSMS/coverage.htm wrote:
Image 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

Image 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


It's a good list to have if you want to offer messeges to every provider imaginable. :) A simple google search for anyone of thoses can find the address for sms'ing a subscriber of their service.


Top
 Profile  
 
 Post subject: nice idea
PostPosted: Fri May 16, 2003 6:54 am 
Offline
Forum Contributor
User avatar

Joined: Mon Apr 28, 2003 7:10 am
Posts: 215
Location: Leeds
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.


Top
 Profile  
 
 Post subject: Re: nice idea
PostPosted: Thu Jun 05, 2003 6:26 pm 
Offline
PHP Evangelist
User avatar

Joined: Tue Aug 13, 2002 3:35 pm
Posts: 3547
Location: Calgary, Canada
irealms wrote:
when people didn't have net access they could still send messages to the site that people could read.


SMS are sent like email, so it's pretty much impossible to display on a page.

But it is good for an 'Instant Alert' service you could provide where your web site members/visitors can receive information from you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 05, 2003 7:24 pm 
Offline
Moderator
User avatar

Joined: Sat Apr 20, 2002 3:14 pm
Posts: 1416
Location: Dallas, TX
We could set up a one-line code that will SMS yourself whenever a visitor visit's your site. :D

_________________
Image Image


Top
 Profile  
 
 Post subject: Re: nice idea
PostPosted: Thu Jun 12, 2003 4:42 pm 
Offline
Forum Newbie

Joined: Thu Jun 12, 2003 4:42 pm
Posts: 1
Location: Bournemouth, UK
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.


Hi - I'm new here and was just looking around when I noticed this post.

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


Top
 Profile  
 
 Post subject: a stupid question .. ><
PostPosted: Mon May 17, 2004 8:59 am 
Offline
Forum Newbie

Joined: Mon May 17, 2004 8:59 am
Posts: 2
I think I should apologize for this stupid question first :P ,
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 9:06 am 
Offline
Admin
User avatar

Joined: Wed Aug 13, 2003 7:02 am
Posts: 4522
Location: York, UK
Have you installed PHP?

http://www.php.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group