Example Code: How to Send SMS from PHP (via Clickatell)
Posted by mypapit on 29 Apr 2011 in Other Programming Language
|
|
Hi there, due to popular demand (requests sent to my personal email – mypapit -at- gmail.com).
I decided to share my old post regarding my simple SendSMS php class which can help php developers to send SMS from their web application
require('SendSMS.php');
$sendsms = new SendSMS("username","password","HTTP POST API key");
/* if the login return 0, means that login failed, you cant send sms after this */
if ( ($sendsms->login()) == 0 ) {
die( "failed");
}
/*other wise, you can send sms using the simple send() call*/
$sendsms->send("0132073011","can you receive this message? Hello there....");
Requirements
To use SendSMS class, you need:
- To enable php curl or libcurl-emu
- Register a Clickatell account, and have a few SMS credits to spare
That’s it.. contact me if you’ve more questions
Download SendSMS PHP class (version 0.5)
.
.
.
Tags: class, click, clickatell, coding, developers, Mobile, PHP, phpclass, programming, short message service, sms, texting, webservice
Keep updated with the latest posts, be a part of over 1,000 subscribers! :
Subscribe to your email
You might also want to read...
- Sending HTTP POST with php cURL
- Kad Raya anyone?
- How to use Celcom Broadband Prepaid on Ubuntu Linux
- Quick Way to send files to mobile device via Bluetooth in Ubuntu Linux
- How to add “Send To” removable USB drive in GNOME
- Nokia releases Python for S60 source code (pys60)
- libcurlemu – a pure PHP curl implementation (libcurl emulator)


April 30th, 2011 at 8:39 am
Thank you for sharing this. But there is any script exist that work with my server no need to register on other blog. just sent sms by uploading the script on server
May 1st, 2011 at 2:56 am
care to point out where we can find the script?
May 15th, 2011 at 12:45 am
very nice article…i have successfully send message through Clickatell, but i also get this message :
Deprecated: Function split() is deprecated in C:\xampp\htdocs\api\SendSMS.php on line 61.
May 15th, 2011 at 2:42 pm
Pitso, in a production server you should turn off the deprecated warning, it’s a good security practice
May 15th, 2011 at 3:11 pm
Pitso, another option is to replace ‘split’ with ‘explode’ in the php class