I have a php script that waits to receive a POST, and when it does it performs some manipulation of the data within the post's body, and returns a string to where the POST came from.
My code looks like:
Code: Select all
<?php
$host = gethostbyname($_SERVER['REMOTE_ADDR']);
$myPIN = $_POST['PIN'];
$key = "key=" . $myPIN;
$fp = fsockopen($host, 80);
fputs($fp, "HTTP/1.1 200 Ok\r\n");
fputs($fp,"Content-Type: application/www-url-encoded\r\n");
fputs($fp, "Content-Length: " . strlen($key) . "\r\n\r\n");
fputs($fp, $key);
fclose($fp);
?>Thanks