I am trying to call an sms api using a http url .I am trying to call the url using curl in php.I get a BAD REQUEST error .Please explain what I am doing wrong.
// create a new cURL resource
$ch = curl_init();
$string1 = "http://api.znisms.com/post/smsv3.asp?userid=alpesh67&apikey=74c6314840a16c5e7db00415a03181f7&message= Congratulation you have been successfully registered in the Placement Management System
Email:".$email."
Password:".$password."&senderid=PMS12345&sendto=".$contactno."";
echo $string1;
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $string1);
// grab URL and pass it to the browser
curl_exec($ch);
//close cURL resource, and free up system resources
curl_close($ch);
//SMS END
I get the following error:
http://api.znisms.com/post/smsv3.asp?userid=alpesh67&apikey=74c6314840a16c5e7db00415a03181f7&message= Congratulation you have been successfully registered in the Placement Management System Email:alpeshhi@gmail.com Password:123456789&senderid=PMS12345&sendto=9773396773
Bad Request