Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/03/2007, 09:08
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: pasar variables por método POST sin usar formulario

Tienes que hablar directamente con el script usando sockets y escribiendo la informacion que necesitas, algo asi:

Código PHP:
$postVars = array(
      
"variable1" => "valor",
      
"variable2" => "valor2" 
);
$host "dir.ip.del.server"// o su dominio
$path "/path/al/script.php.o.jsp.o.lo.que.sea";
$data http_build_query$postVars );

$fh fsockopen($host80$errorNumber$errorString);
$request "POST ".$path."  HTTP/1.1\r\n";
$request.= "Host: ".$host."\r\n";
$request.= "User-Agent:      Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0\r\n";
$request.= "Content-Type: application/x-www-form-urlencoded\r\n";
$request.= "Content-Length: ".strlen($data)."\r\n";
$request.= "Connection: close\r\n\r\n";
$request.= $data;

fwrite$fh$request );
$response "";
while( !
feof$fh ) ) {
     
$response .= fread$fh1024 );
}
fclose$fh );
echo 
"Servidor respondio: " $response