Share Pastebin
Guest
Public paste!

MIchoacano

By: a guest | Nov 15th, 2007 | Syntax: PHP | Size: 0.68 KB | Hits: 449 | Expires: Never
Copy text to clipboard
  1. <?
  2.  
  3.  
  4.  
  5.         $host="www.tupagina.com";
  6.         $referer="http://referer.com";
  7.  
  8.         $uri="/pagina.php";
  9.  
  10.         $vars="&parametro1=valor1&parametro2=valor2";
  11.  
  12.  
  13.         $header = "Host: $host\r\n";
  14.  
  15.         $header .= "User-Agent: Mosaic\r\n";
  16.  
  17.         $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
  18.  
  19.         $header.="Referer: $referer\r\n";
  20.  
  21.         $header .= "Content-Length: ".strlen($vars)."\r\n";
  22.  
  23.         $header.="Pragma: no-cache\r\n";
  24.  
  25.         $header .= "Connection: close\r\n\r\n";
  26.  
  27.  
  28.         $fp = pfsockopen("tcp://".$host, 80, $errno, $errstr, 20);
  29.  
  30.         fputs($fp, "POST $uri HTTP/1.1\r\n");
  31.  
  32.         fputs($fp, $header.$vars);
  33.  
  34.         while (!feof($fp))
  35.  
  36.         {
  37.  
  38.                 echo fgets($fp, 128)."<br>";
  39.  
  40.         }
  41.  
  42.         fclose($fp);
  43.  
  44. ?>