Jump to content

Inconsistent response to GET


artied

Recommended Posts

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

 

I have set up a 'receiver' page at tally.ie/borda/receiver.php.  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 tally.ie/test.html and one at doohan.org/borda/test2.html). These both generate correct messages, wherever they are used.

 

The server transcribing the SMS messages is sending correctly formatted messages but the 'receiver' 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 "http://tally.ie/test.html" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.3) 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.

 

Code for the receiver is attached

 

Thanks in advance.

 

AD

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/200294-inconsistent-response-to-get/
Share on other sites

Here is the code for the receiver script

 

<?php

 

// 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"];

  }

 

  print_r($_GET);

  echo "<br>", $mobNumbr, " ", $sMessage , "<br>";

  echo "Valid Message received and processed";

 

} // if empty()

else{

  // Missing data: Go back to the <form>

  echo "Bad Message received and processed";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.