Ver Mensaje Individual
  #5 (permalink)  
Antiguo 20/03/2012, 13:39
jeshua3001
 
Fecha de Ingreso: octubre-2006
Mensajes: 128
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: [APORTE] file_get_contents(), cURL, HTTP_Request

de esta forma lo estoy haciendo pero no se si esta bien
Cita:
<?php
$curl = curl_init();
$id=1;
$total=1;
$tipo_pago=1;
$merch="123456789";
$store="0";
$term="2003";
$url = "http://host-remoto/datos.php";
curl_setopt($curl, CURLOPT_URL, $url);
$postdata = "id=".$id;
$postdata .= "&total=".$total;
$postdata .= "&tipo_pago=".$tipo_pago;
$postdata .= "&merch=".$merch;
$postdata .= "&store=".$store;
$postdata .= "&term=term";
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cook_file);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cook_file);
$str = curl_exec($curl);
echo $str;
?>
envia los datos a http://host-remoto/datos.php el cual verifica los datos con un javascript y envia a http://host-remoto/respuesta.php al hacer click.

como hacer esto con cURL? la idea era que enviara los datos y luego en me imprimiera la pagina http://host-remoto/respuesta.php para hacer click y continuar pero si hay una forma de solo enviar los datos por curl y que solo te envia la respuesta si es correcto o no