Forum Moderators: coopster
function post($host, $path, $data) {
$http_response = '';
$content_length = strlen($data);
$fp = fsockopen($host, 80);
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-Length: $content_length\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
while (!feof($fp)) $http_response .= fgets($fp, 28);
fclose($fp);
return $http_response;
}$postdata = '?foo=bar';
foreach($_POST as $key => $val) $postdata .= '&'.$key.'='.$val;$http_response = post('example.org', '/path/to/script.php', $postdata);
?>
How would I list the urls which I would like it to be posted to?
And welcome to WebmasterWorld, joshm.
I renamed all the title[] field names to see what happens. It still posts 'A' to the db, even though the field names are like 'title1', 'title2' etc. I use this form already but it submits as a single post. I think the above code is not getting the title data properly. Any thoughts as to how the code can be modified to pick up all the field data? I imagine an array would have to be made to catch all the data but i've got no idea how to do it.