I am getting this error while working on curl code
Warning: curl_setopt() expects parameter 1 to be resource, string given in C:\xampp\htdocs\
<?php
//initialize the request variable
$request = "";
//this is the username of our TM4B account
$param["username"] = "kacs";
//this is the password of our TM4B account
$param["password"] = "698117";
//this is the message that we want to send
$param["msg"] = "This is sample message.";
//these are the recipients of the message
$param["to"] = "90138933";
//this is our sender
$param["from"] = "SHRDIA";
//traverse through each member of the param array
foreach($param as $key=>$val){
//we have to urlencode the values
$request.= $key."=".urlencode($val);
//append the ampersand (&) sign after each paramter/value pair
$request.= "&";
}
//remove the final ampersand sign from the request
$request = substr($request, 0, strlen($request)-1);
//this is the url of the gateway's interface
$url = "http://abulksms.com/pushsms.php";
//initialize curl handle
$ch = curl_init;
curl_setopt($ch, CURLOPT_URL, $url); //set the url
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable
curl_setopt($ch, CURLOPT_POST, 1); //set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); //set the POST variables
$response = curl_exec($ch); //run the whole process and return the response
curl_close($ch); //close the curl handle
//show the result onscreen for debugging
//print $response;
?>