[thelist] POST without form
Pablo Oliva
poliva at cox.net
Sun Sep 15 00:20:01 CDT 2002
--
[ Picked text/plain from multipart/alternative ]
I know someone was trying to post info without a form. They were
referred by someone on this list to the following script:
http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51
I have modified this PHP script slightly:
function sendByPost( $path, $data )
{
$host = 'localhost';
$fp = fsockopen( $host, 80 );
fputs( $fp, "POST $path HTTP/1.1\n" );
fputs( $fp, "Host: $host\n" );
fputs( $fp, "Content-type: application/x-www-form-urlencoded\n" );
fputs( $fp, "Content-length: ".strlen( $data )."\n" );
fputs( $fp, "Connection: close\n\n" );
fputs( $fp, $data );
while ( !feof($fp) )
$buf .= fgets( $fp, 128 );
fclose( $fp );
return $buf;
}
AND am calling it with:
$data = 'cn=Name';
$path = '/jotr/compSignUp.php';
sendByPost( $path, $data );
Did whoever was working on this get the script to work? My script just
hangs, and does nothing.
--
More information about the thelist
mailing list