When sms is sent from a website via my office internet, the codes works excellent but when i browse the site using mobile phone to send sms, it displays the error below.
Then, when I connect the site to internet via 3G USB Moderm, the same error ensued. it seems that its simcard port number of the phone could not be allowed to send sms.
this is the error
Not Acceptable
An appropriate representation of the requested resource /components/com_spc/smsapi.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4 Server at www.nigerianbulksms.com Port 80
below is the working code
<form action="sms.php" method="post">
<table align="center" width="50%">
<tr><td>Phone Number </td><td><input type="text" name="recipient" value="" /></td></tr>
<tr><td></td><td><input type="submit" value="Send Message" name="submit" /></td></tr>
</table>
</form>
<?php
$user="im";
$senderID="fred";
$pass='im606';
$receipientno="";
$cid="";
$mess="welcome";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, "http://www.nigerianbulksms.com/components/com_spc/smsapi.php?username=$user&password=$pass&recipient=".$_POST['recipient']."&sender=$senderID&message=$mess");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
12
curl_setopt($ch, CURLOPT_POST, 1);
13
curl_setopt($ch, //CURLOPT_POSTFIELDS,"user=$user&senderID=$senderID&receipientno=$receipientno&cid=$cid");
$buffer = curl_exec($ch);
print($buffer);
curl_close($ch);
?>