Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/05/2011, 20:13
eduardo160
 
Fecha de Ingreso: julio-2010
Mensajes: 523
Antigüedad: 13 años, 9 meses
Puntos: 4
Respuesta: resultado de busqueda como enlace

el primer archivo donde haces la consulta y todo eso:
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. </head>
  7.  
  8. <body>
  9. <?php require_once('../Connections/drcoche.php'); ?>
  10. <?php $nombre=$_POST['nombre']; ?>
  11. <?php $dni=$_POST['dni']; ?>
  12. <?php
  13. if (!function_exists("GetSQLValueString")) {
  14. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  15. {
  16. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  17.  
  18. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  19.  
  20. switch ($theType) {
  21. case "text":
  22. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23. break;
  24. case "long":
  25. case "int":
  26. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  27. break;
  28. case "double":
  29. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  30. break;
  31. case "date":
  32. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  33. break;
  34. case "defined":
  35. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  36. break;
  37. }
  38. return $theValue;
  39. }
  40. }
  41.  
  42. mysql_select_db($database_drcoche, $drcoche);
  43. $query_pornombre = "SELECT Nombre, Apellidos, DNI, Poblacion, Telefono, Correo, Matricula FROM clientes WHERE nombre='$nombre' or dni='$dni' ORDER BY nombre ";
  44. $pornombre = mysql_query($query_pornombre, $drcoche) or die(mysql_error());
  45. $row_pornombre = mysql_fetch_assoc($pornombre);
  46. $totalRows_pornombre = mysql_num_rows($pornombre);
  47. while ($row = mysql_fetch_array($pornombre)){
  48.     $DNI= $row['DNI'];
  49.    
  50.     echo "<br>";//esto es para que no muestre todos los datos uno junto a otro si no con un salto de linea
  51.     echo"<a href='procesardni.php?dni=".$DNI."'>Informacion de ".$DNI."</a>";
  52.    
  53.    
  54.    
  55. }
  56.  
  57. ?>
  58. </body>
  59. </html>