Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response to sender of a $POST 3

Status
Not open for further replies.

maharg

Technical User
Mar 21, 2002
184
Hi

I am trying to develop an application where I parse data received from a POST. The POST is happening every 10 seconds approx, with a text data packet of around 10kb. I parse the data and save it to a dB.

If the data is received malformed, or if for any reason I want the sender to resubmit it, I want to send an http response to the sender.

Can be just a OK or ERROR, or 1 or 0

What would be the best mechanism for this?

 
I meant to mention - the POST is automated, by the way, not via a person.
 
just echo whatever you want.

Code:
error_reporting(0);
if ( dosomething_with($_POST) ):
  echo 'all good';
else:
  echo 'something went bang';
endif;
 
Hi

Or set an adequate HTTP response code :
PHP:
[b]if[/b] [teal](![/teal] [COLOR=darkgoldenrod]dosomething_with[/color][teal]([/teal][navy]$_POST[/navy][teal])[/teal] [teal]):[/teal]
  [COLOR=darkgoldenrod]header[/color][teal]([/teal][green][i]'HTTP/1.1 400 Bad Request'[/i][/green][teal]);[/teal]
[b]endif[/b][teal];[/teal]


Feherke.
 
Thanks for your input! This is totally different from what I normally do, so I really appreciate your guidance. We have http responses handshking happily now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top