Send SMS through way2sms using php
1. download one rar file - click here to download
2. extract the rar file
sms.php
<HEAD>
<TITLE> </TITLE>
</HEAD>
<body bgcolor=#FFFFC0>
<form name="form1" action="sms.php" method="post" >
<?php
$to=$_POST['to'];
$body=$_POST['body'];
?>
<table>
<tr><td><p>Phone number:</p></td><td><input name="to" id="No1" value="<?echo $to; ?>" size="53" ></td></tr>
<tr><td><p>Message:</p></td><td><textarea name="body" cols="40" rows="3"><?echo $body; ?></textarea></td></tr>
<tr><td> </td><td><input type="submit" value="Send SMS" ></td></tr>
</table>
<?
if($to!='' && $body!='') {
include_once "../alfa/alfa.sms.class.php";
/*
If you get Fatal error: Call to undefined function curl_init() ,
Then you need to enable the curl extension in php.ini from your controlpanel.
If your server is not supporting cURL use my online version @ www.alfredfrancis.in/alfasms-api
*/
//initialising AlfaSMS API Class
$sms=new AlfaSMS();
echo " Logging in.. <br>";
//Replace useranme and password with your way2sms username and password
$result=$sms->login('9047956658','password');
if($result)
{
echo "Sending SMS..<br> ";
//It'll be my pleasure to receive a sms from you
$result=$sms->send($to,$body);
if($result)
{
echo " SMS send sucessfully !";
}
else
{
echo " Cant send SMS,Invalid content or Mobile number !<br>";
}
}
else
{
echo " Wrong username or password!<br>";
}
echo " Logging out ... <br>";
$sms->logout();
}
//Alfasms is loging out
?>
</form>
</BODY>
</HTML>
***************** important remark *************
Go to your php.ini file and remove the ; mark from the beginning of the following line:
;extension=php_curl.dll
its not working man
ReplyDeletehttps://github.com/kingster/Way2SMS-API
DeleteIts Working ...
ReplyDeletefed uppp with thiss...
ReplyDeletefatal error: Call to undefined function curl_init() in C:\wamp\www\shenvell\templatemo_329_blue_urban\alfa\alfa.curl.class.php on line 80
Call Stack
# Time Memory Function Location
1 0.0006 253888 {main}( ) ..\sms.php:0
2 0.0029 319840 AlfaSMS->login( ) ..\sms.php:29
3 0.0029 320248 AlfacURL->post( ) ..\alfa.sms.class.php:38
Go to your php.ini file and remove the ; mark from the beginning of the following line:
ReplyDelete;extension=php_curl.dll
in php.ini file search the line
Delete;extension=php_curl.dll
remove ;
extension=php_curl.dll
save the file and restart apache or wamp server
i have figured out the problem with my wamp Tamil. and now my curl is enabled..
ReplyDeletegot error in code saying..
phoneno hai Logging in..
Sending SMS..
Cant send SMS,Invalid content or Mobile number !
Logging out ...
This comment has been removed by the author.
ReplyDeletewhere is php.ini file
ReplyDeleteplz explain procedure in detail
I too am facing the same error...
ReplyDeleteLogging in..
Sending SMS..
Cant send SMS,Invalid content or Mobile number !
Logging out ...
what is the solution to this
https://github.com/kingster/Way2SMS-API
Deleteuse this api
Notice: Undefined offset: 0 i got this error repeatedly can anyone help to figure out this.
ReplyDeletehttps://drive.google.com/file/d/0B9DBPH5xymtxN1MwN0d6NHNnaWs/view?usp=sharing
ReplyDeleteWORKING CODE.. ANYONE CAN DOWNLOAD---- ENTER YOUR PHONE NUMBER AND PASSWORD..
IT WORKS.... 100%..........
hi pandian
Deleteim trying on your code but still not working on my localhost
code works 100%, sms sending functionality is working perfectly. and only one thing you need to modify in index.html file replace hidden keyword with placeholder. heartfull thankful to Mr.pandian M sir.
ReplyDeleteThanks for sharing. This code is not properly work. Use MsgClub Bulk sms api php and send number of sms.
ReplyDelete