Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $data = array();
- while(list($n,$v) = each($_data)){$data[] = "$n=$v";}
- $data = implode('&', $data);
- $url = parse_url('http://google.com');
- // $url = parse_url('http://awsmteam.com/verify_adult_content.php');
- $host = $url['host'];
- $path = $url['path'];
- $port = 80;
- $data_length = strlen($data);
- $header = "POST $path HTTP/1.0\r\n";
- $header .= "Host: $host\r\n";
- $header .= "User-Agent: DoCoMo/1.0/P503i\r\n";
- $header .= "Content-type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-length: $data_length\r\n";
- $header .= "\r\n";
- $fp = fsockopen($host,$port,$err_num,$err_msg,120);
- fputs($fp, $header . $data);
- while(trim(fgets($fp,4096)) != '');//Retira o cabecalho HTTP
- while(!feof($fp)){$response .= fgets($fp,4096);}
- // close the socket connection:
- fclose($fp);
- if ($response == 'OK'){
- return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement