Reputation: 734
I am running the following code and getting this error:
Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.
<?php
$phone = "1236547895";
$message = 'Dear '.$firstname.' '.$lastname.',
Your invoice (#'.$invoiceid.') is successfully paid on '.$datepaid.' at Hostomy. Thank you for choosing us.
Regards,
Hostomy
';
$url = "https://www.example.com/file.php?phone=".$phone."&message=".$message."";
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
?>
Upvotes: 6
Views: 18033