Forum Moderators: coopster
Ben
There are a number of ways to accomplish the task and yes, POST is one of them. You could assemble your own POST headers and fire them off. The following is an example that should get you started in the right direction:
if (isset($_POST['Submit'])) {
$date = urlencode [php.net]($_POST['date']);
$email = urlencode [php.net]($_POST['email']);
$list = urlencode [php.net]($_POST['list']);
$fp = fsockopen [php.net]('www.example.com', 80, $errno, $errstr, 30);
if (!$fp) {
// handle it somehow if you receive an error;
// maybe write to a text file or log file on the remote server.
} else {
$out = "POST /mylogs/mylogscript.php HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Content-Length: " . strlen("date=$date&email=$email&list=$list") . "\r\n";
$out .= "Connection: close\r\n\r\n";
$out .= "date=$date&email=$email&list=$list";
fwrite($fp, $out);
$response = '';
while (!feof($fp)) {
$response .= fgets($fp, 128);
}
fclose($fp);
}
}