This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
58 lines (47 loc) · 1.73 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/*********************************************************************************
* Alfasms API 4.0 for way2sms *
* Author : Alfred francis *
* Email : [email protected] *
* API homepage : www.alfredfrancis.in/alfasms-api *
* Feel free to edit,share and publish. *
* *
* Simple usage *
* ------------ *
* <?php *
* include_once "alfa.sms.class.php"; *
* $sms=new AlfaSMS(); *
* $result=$sms->login('username','password'); *
* $sms->send('8089617433','Thanks Alfred,your API works perfectly.'); *
* $sms->logout(); *
* ?> *
*********************************************************************************/
include_once "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 "Alfasms is Logging in.. <br>";
//Replace useranme and password with your way2sms username and password
$result=$sms->login('username','password');
if($result)
{
echo "Alfasms is Sending SMS..<br> ";
//It'll be my pleasure to receive a sms from you
$result=$sms->send('8089617433','Thanks Alfred,your API works perfectly.');
if($result)
{
echo "Alfasms: SMS send sucessfully !";
}
else
{
echo "Alfasms: Cant send SMS,Invalid content or Mobile number !<br>";
}
}
echo "Alfasms is Logging out ... <br>";
//Alfasms is loging out
$sms->logout();
?>