Foros del Web » Programando para Internet » PHP »

obtener datos de otra web

Estas en el tema de obtener datos de otra web en el foro de PHP en Foros del Web. Tengo dos archivos search.php (aqui yo introduzco los seriales de unos carros, para que me muestre el reporte de ese carro) y report.php, tengo una ...
  #1 (permalink)  
Antiguo 29/02/2016, 16:55
 
Fecha de Ingreso: febrero-2016
Mensajes: 3
Antigüedad: 8 años, 2 meses
Puntos: 0
Mensaje obtener datos de otra web

Tengo dos archivos search.php (aqui yo introduzco los seriales de unos carros, para que me muestre el reporte de ese carro) y report.php, tengo una cuenta en https://www.carfax.es y quiero que el reporte que me muestra se me muestre en otra web que tengo o en el mismo report, como pueden ayudarme muestro los dos codigos:

search.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Searching</title>
</head>
<body>
<div style="margin-top:100px">
<table border="0" cellspacing="0px" width="250px" height="50px" align="center">
<tr>
<td>
<form name="formulario" method="post" action="report.php">
<input type="submit" value="Buscar" title="Buscador" />
<input type="text" name="vinc" placeholder="1234ABC" autocomplete="off" maxlength="18" />
</form>
</td>
</tr>
</table>
</div>
</body>
</html>

report.php
<?php
$report = $_POST['vinc'];
//echo '<a href="https://www.carfax.es/frcajax/'.$report.';">Reporte Cargado...</a>';
//$url = 'https://www.carfax.es/frcajax/'.$report;

//$str = file_get_contents ('$url');
//echo htmlentities($str);

$url = "https://www.carfax.es/frcajax/" . urlencode($report);
//$data = file_get_contents($url);

?>

<form method="post" action="https://www.carfax.es/frcajax/<?php echo $report; ?>" target="_self">
<input type="submit" value="Siguiente" title="Seguir" />
<input type="hidden" name="report_id" value=""/>
</form>

<!--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Report</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script>
function cargar(){
var url="tabla.php"
$.ajax({
type: "POST",
url:url,
data:{},
success: function(datos){
$('#rep').html(datos);
}
});
}
</script>
</head>
<body>
<div>
<a href="#" onclick="cargar();">Siguiente</a>
</div>
<div id="rep"></div>
</body>
</html>
-->
  #2 (permalink)  
Antiguo 02/03/2016, 21:23
Avatar de ikaroraul  
Fecha de Ingreso: octubre-2006
Ubicación: La Paz
Mensajes: 391
Antigüedad: 17 años, 7 meses
Puntos: 16
Respuesta: obtener datos de otra web

Puedes usar cURL para crear un pequeño spider el cual te extraiga los datos de la segunda web.
__________________
Msn: [email protected]
  #3 (permalink)  
Antiguo 02/03/2016, 22:16
Avatar de AlejandraLara  
Fecha de Ingreso: octubre-2015
Mensajes: 115
Antigüedad: 8 años, 6 meses
Puntos: 19
Respuesta: obtener datos de otra web

Según yo no se puede (?)
__________________
Si le das el código hecho a alguien nunca va a aprender ni te dará las gracias, si le dices como hacerlo aprenderá y te dará las gracias (algún día).

Etiquetas: formulario, html, tabla
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:13.