http request post

From: Date: Mon, 11 Dec 2000 17:57:54 +0000
Subject: http request post
Groups: php.dev 
Request: Send a blank email to php-dev+get-40878@lists.php.net to get a copy of this message
Hi everybody I want to scan a site which is using the POST method the url I want to open is like http://www.site.com/page.asp?var1=val1&var2=val2... So I open a socket on a port of the server using fsockopen then I do a fputs on the file descriptor returned by fsockopen: fputs($fd, $request) where request is like $request = "POST http://www.site.com/page.asp User-Agent: Mozilla/4.7 [en] (WinNT; I) Host: www.site.com Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* Accept-Language: en Accept-Charset: iso-8859-1,*,utf-8 Cookie: SITESERVER=GUID=4151560b6c764aec6f40f5f55199b7fd; MemRightsChanged=1SsiOg== Content-type: application/x-www-form-urlencoded Content-length: $len Connection: Keep-Alive var1=val1&var2=val2...\n"; where $len = strlen(var1=val1&var2=val2...); But that doesn't work, why ???? If something is wong in what I've done, please tell me, thanks. Laurent

« previous php.dev (#40878) next »