Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/02/2013, 13:46
Avatar de kendall00
kendall00
 
Fecha de Ingreso: septiembre-2011
Ubicación: $Ubicacion => ['Costa Rica'];
Mensajes: 85
Antigüedad: 12 años, 7 meses
Puntos: 5
Respuesta: Necesito un codigo para visitar URLs.

Código PHP:
Ver original
  1. <?
  2. #pedona si hay un error de sintaxis
  3. function enviar ($url){
  4. $handler = curl_init($url);
  5. $response = curl_exec ($handler);
  6. curl_close($handler);  
  7. return $response;
  8. }
  9. $enlace = mysql_connect('servidor', 'usuario_mysql', 'contraseña_myql');
  10. if (!$enlace) {
  11.     die('No se pudo conectar : ' . mysql_error());
  12. }
  13. $bd_seleccionada = mysql_select_db('tu_bd', $enlace);
  14. if (!$bd_seleccionada) {
  15.     die ('No se pudo seleccionar : ' . mysql_error());
  16. }
  17. $tabla = 'tu_tabla';
  18. $resultado = mysql_query("SELECT * FROM $tabla");
  19. while($row = mysql_fetch_array($resultado)){
  20.  echo "Response de ". $row['url']. " :/n".enviar($row['url'];
  21. }
  22. ?>
__________________
El limite es la imaginacion... con Dios todo es posible.