2

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);
?>
jackJoe
  • 11,078
  • 8
  • 49
  • 64
user3368813
  • 47
  • 2
  • 7
  • Try to debug your request from the mobile browser: `406 Not Acceptable The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.[2]` look this question/answer: http://stackoverflow.com/questions/14251851/what-is-406-not-acceptable-response-in-http also look this one: http://stackoverflow.com/questions/374885/can-i-change-the-headers-of-the-http-request-sent-by-the-browser – Allende Mar 10 '14 at 19:54
  • 1
    It looks like your mobile ISP has put a transparent proxy that changes some of the headers sent by your browser - try running a packet capture on your server and look at the phone's request headers, and then configure your webserver to ignore those headers and to still execute the PHP code. –  Mar 12 '14 at 03:55
  • Maybe the scripts redirects you to a WAP gateway. The gateway detects a mobile IP address and you are identified as mobile user with no access. – Tim Mar 14 '14 at 13:52
  • thank you. i will work on that and then get back to you. – user3368813 Mar 15 '14 at 20:19

0 Answers0