Inconsistent response to GET

Alles, was PHP betrifft, kann hier besprochen werden.

Inconsistent response to GET

Postby artied » 01. May 2010 21:05

I am trying to interact with some HTTP GET's that are being sent to me as transcriptions of SMS messages.

I have set up a 'receiver' page at A correctly formatted message should come in two parts. If one is received the message is parsed and the contents echoed to the browser. Any other message echoes an error message to the browser.

I have set up 2 test message sender pages (one at and one at These both generate correct messages, wherever they are used. ie the server/apache/php does what I was expecting.

The server transcribing the SMS messages is sending correctly formatted messages but the 'receiver' script is not reacting to them at all.

Here are two sample lines from the access logs.

109.78.61.*** - - [30/Apr/2010:03:18:52 -0600] "GET /borda/receiver.php?mobilenumber=353868557677&command=borda+tally+test HTTP/1.1" 200 493 "" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv: Gecko/20100401 Firefox/3.6.3"

83.138.8.*** - - [30/Apr/2010:03:08:40 -0600] "GET /borda/receiver.php?mobilenumber=353868557677&command=Borda%20vote%20cabde HTTP/1.1" 200 493 "-" "-"

The first is an example of what is sent by one of my 'test submitter' HTML pages. The second is an example of what comes from the 'transcriber' service. The first triggers a response from 'receiver.php' and the second get 'bupkiss'…….

My problem is that the PHP script does not interact with the messages from the transcriber but it does with the messages sent from the HTML pages.

I do not believe that this is a formatting situation as the 'receive.php' script is set to give an error message if it receives anything at all that is badly formed and to echo the message if it is correctly formatted. It appears that the script is just not 'seeing' the GET at all.

What do i need to change in order to trap these messages, pls.

Thanks in advance.


This is the 'receiver' code….

Code: Select all

// Test for user input - If none of the data elements are missing then strip and save the message string
// No error checking at this stage - just catch a well formed string
if (!empty($_GET["mobilenumber"]) && !empty($_GET["command"])
  $mobNumbr = $_GET["mobilenumber"];
  $sMessage = $_GET["command"];

  echo "<br>", $mobNumbr, " ", $sMessage , "<br>";
  echo "Valid Message received and processed";

} // if empty()
  // Missing data: Go back to the <form>
  echo "Bad Message received and processed";
Posts: 1
Joined: 01. May 2010 20:57

Return to PHP

Who is online

Users browsing this forum: No registered users and 1 guest