ayex2012 Posted April 6, 2012 Share Posted April 6, 2012 Good day programmers, please I'm a novice in coding and I need help with a script where people can send invitation message to their friend on my site as sms. I want users on my site to just drop the phone number of their friends only in the html form and it automatically sends the message I have configured to the number the member placed in the form. I'm hosted with hostgator, though I'm in nigeria, I run SMF 2.0.1 forum on my site, my targeted members are nigerians too. I have sms gateway with bbnsms.com, please guyz I need the script and html form for only phone number field(No message Field) as I want to send the same message that I already compose to all the phone numbers. Thanks guyz. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/ Share on other sites More sharing options...
chriscloyd Posted April 6, 2012 Share Posted April 6, 2012 any code you have already would be great Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334857 Share on other sites More sharing options...
chriscloyd Posted April 6, 2012 Share Posted April 6, 2012 heres a form <html> <body> <h1>My SMS form</h1> <form method=post action='sendsms.php'> <table border=0> <tr> <td>Recipient</td> <td><input type='text' name='recipient'></td> </tr> <tr> <td> </td> <td><input type=submit name=submit value=Send></td> </tr> </table> </form> </body> </html> easiest way is to have it mail it for example if you are wanting to send it to a verizon customer send the mail to [email protected] it all depends on what you want to do, but without buying a sms gateway you are going to want to mail them Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334859 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 any code you have already would be great You mean the code that I a got from my gateway server? Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334861 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 heres a form <html> <body> <h1>My SMS form</h1> <form method=post action='sendsms.php'> <table border=0> <tr> <td>Recipient</td> <td><input type='text' name='recipient'></td> </tr> <tr> <td> </td> <td><input type=submit name=submit value=Send></td> </tr> </table> </form> </body> </html> easiest way is to have it mail it for example if you are wanting to send it to a verizon customer send the mail to [email protected] it all depends on what you want to do, but without buying a sms gateway you are going to want to mail them Thanks for the quick response, I have sms gateway, but what I need is a script that will b sending the message as people put the phone number in the sms form Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334863 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 SMS Examples Sending single text message http://DomainName/bulksms/bulksms.php?username=xxxx&password=xxxxx&messa ge=xxxxxx&mobile=9999999999&sender=xxxxxxx For example the completed URL is: http://www.bbnsms.com/bulksms/[email protected]&passwo rd=mypasswd&message=TestMessage&mobile=238088888888&sender=Fumi Sending Multiple text message http://DomainName/bulksms/bulksms.php?username=xxxx&password=xxxxx&messa ge=xxxxxx&mobile=238088888888, 238088888888, 238088888888, 238088888888, 238088888888&sender=xxxxxxx The above Url is the basic HTTP BULK link structure where the details about each parameter is given below: For example the completed URL is: http://www.bbnsms.com/bulksms/[email protected]&passwo rd=mypasswd&message=TestMessage&mobile=238088888888, 238088888888, 238088888888, 238088888888, 238088888888&sender=Kemi Thats d format of how my sms gateway works with example. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334865 Share on other sites More sharing options...
hackalive Posted April 6, 2012 Share Posted April 6, 2012 You can also use the skype API. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334866 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 You can also use the skype API. I hav my own sms gateway that i hav paid to. Thats their m format above, if i type those samples above in browsers, with real details it will send sms just fine. Bt i need to script it so that my member on my site can b able to use it by just typing in the phon numbers in the form "chriscloyd" just gave me the code. Thanks gurus. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334869 Share on other sites More sharing options...
chriscloyd Posted April 6, 2012 Share Posted April 6, 2012 yo can use ajax <script type="text/javascript"><!-- function ajaxRequest(){ var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) for (var i=0; i<activexmodes.length; i++){ try{ return new ActiveXObject(activexmodes[i]) } catch(e){ //suppress error } } } else if (window.XMLHttpRequest) // if Mozilla, Safari etc return new XMLHttpRequest() else return false } var mygetrequest=new ajaxRequest() mygetrequest.onreadystatechange=function(){ if (mygetrequest.readyState==4){ if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){ document.getElementById("result").innerHTML=mygetrequest.responseText } else{ alert("An error has occured making the request") } } } var mobilevalue=encodeURIComponent(document.getElementById("mobile").value) var textvalue=encodeURIComponent(document.getElementById("message").value) mygetrequest.open("GET", "http://www.bbnsms.com/bulksms/[email protected]&passwo rd=mypasswd&message="+textvalue+"&mobile="+mobilevalue+"&sender=Kemi", true) mygetrequest.send(null) --></script> Question how will he be defining the message? Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334874 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 Thanx for d help chriscloyd plz i hav no php background, as what i want to ask maybe stupid, plz lets assume my message is Hi there, a friend of yours has invited you to join www.naijatechzone.com, do visit us soon. please how will put that in the code. And most importantly how will i link this script with the html form??? will i create a "sendsms.php" and paste it in my file manager then paste this script and dats all??. Thanx for your time. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334876 Share on other sites More sharing options...
ayex2012 Posted April 6, 2012 Author Share Posted April 6, 2012 Plz im begging how do i do connect the script, what do i do with it please help. Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1334896 Share on other sites More sharing options...
ayex2012 Posted April 7, 2012 Author Share Posted April 7, 2012 Please I'm still waiting anyone that wants to help out Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1335135 Share on other sites More sharing options...
chriscloyd Posted April 8, 2012 Share Posted April 8, 2012 do a javascript command or ajax. onwindows load do initpage function or something for example <script type="javascript/text"> window.onload = pageChecker; function pageChecker() { document.getElementById['submit'].onSubmit = do the function of sending the form with javascript } </script> For the message you can put a hidden value in the form that sends the same message all the time Quote Link to comment https://forums.phpfreaks.com/topic/260430-help-sending-sms-from-my-php-website-script/#findComment-1335399 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.