w3schools Logo
Saturday 28 January 2012
w3schools.in Developer Network Made in INDIA

PHP Tutorial

How to Learn PHP PHP Home
PHP Intro PHP Syntax PHP Variables and String PHP Operators PHP Date and Time PHP If...Else PHP Switch PHP Arrays PHP Looping PHP Functions PHP $_GET and $_POST
PHP String Manipulation PHP Form Validation PHP Include PHP Headers PHP Files PHP File Upload PHP Cookies PHP Sessions PHP E-mail PHP XML RSS PHP Exception PHP Interview Questions

php Articles

Useful functions to tighten the security in PHPCodeIgniter A recommendation for PHP ProgrammerPHP Framworks Why when and which Solving Floating point number precision lost problem in PHPHandling array of HTML Form Elements in JavaScript and PHPHow to filter user submitted data easily in PHPPrevent form post request from another domain in PHPFlaw in and or logical operator phpDefault arguments functions phpSubmit Form without Refreshing Page with JqueryMySQL Performance TipsFree ajax chat applications in PHPReturn More Than One Value From a Function in PHPPHP Optimization TipsPHP Error HandlingUseful PHP Classes and LibrariesUseful Tools For PHP DevelopersPHP FrameworksWeb based HTML Editors301 redirect in PHP and .htaccessHiding PHP file extensionRredirect Browser HTTPS SSL PHPTighten php security functionsPHP Framworks

MySQL Database

MySQL Introduction MySQL Connect DDL, DML and DCL commands? MySQL Create MySQL Insert MySQL Select MySQL Where MySQL Join MySQL Order By MySQL Update MySQL Delete

PHP Example Scripts

PHP MySql Resume management script Javascripts/Css Date Picker script Css Pagination Styles Sample Blog with user management and admin PHP Forum & Discussion Board Scripts PHP Captcha



PHP Tutorials Lessons

How to Send Email from a PHP Script

Only registered member can view this page.

Join w3

 



Vishal
2009-10-07 05:10:06 842day

Using curl functions in php to send sms --


<?php function sendSMS($num,$msg)
{
//removing URL %20 space if required
$msg str_replace('',"%20"$msg);
$url "http://www.example.com/test.php?usr=$username&pwd=$pass&ph=$num&text=$msg";
        
    
//calling CURL Function
    
$ch=curl_init();
        
curl_setopt($chCURLOPT_URL$url);
        
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
        
$xml curl_exec ($ch);
        
curl_close ($ch);
        print (
"<br>");
        print (
"<br><br>RESULT: ".$xml."<br><br>");        
        
     
//Insert returned data  into mysql database
$insertquery="insert into savesmsreport(report) values('$xml')";
mysql_query($insertquery,1);
return 
$xml;
}
?>

 


Add Comments / Scripts
Name:
E-mail:
Comment: