![]() Topic awaiting preservation: fetching a form that requires POST using FPUTS (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() Greets! |
Maniac (V) Inmate From: Sthlm, Sweden |
![]() Never used fputs for stuff like this, however, we do pass simulated form data through post to remote servers all the time at work. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() yeah, curl is the easier way to go. code: function makeFunnyPost ( $strPath, $strHostName, $arrData ) { $strPostData = ''; foreach ( $arrData as $strKey => $strValue ) { if ($strPostData) $strPostData .= '&'; $strPostData .= urlencode ( $strKey ) . '='. urlencode ( $strValue); } $strRequest = "POST ". $strPath. " HTTP/1.0\r\n". "Host: ". $strHostName . "\r\n". "Content-Type: application/x-www-form-urlencoded\r\n". "Content-length: ". strlen($strPostData). "\r\n". "\r\n". $strPostData. "\r\n"; $fh = fsockopen($strHostName,80); if ($fh) { fwrite($fh,$strRequest); $strResponse = ''; while (!feof($fh)) { $strResponse .= fread($fh,2048); } fclose($fh); $strResponse = trim(substr($strResponse,strpos($strResponse,"\r\n\r\n"))); //cut of http header. return $strResponse; } else return False; }
|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() Alright - I'm not having much luck with this. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() Case Sensitive Option Values. code: <?php $url="http://www.state.mi.us/mdoc/asp/otis2results.asp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); $strPostFields = "last=Kevorkian&first=Jack&gender=Either&race=All&status=All"; curl_setopt ($ch, CURLOPT_POSTFIELDS, $strPostFields ); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $content = curl_exec ($ch); curl_close ($ch); echo $content; ?> |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() Try setting some browser like headers... I'd start with User-Agent |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() In that case, it could easily be the name lookup for the host. |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() |