Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/02/2012, 04:09
FRAN26
 
Fecha de Ingreso: julio-2006
Mensajes: 44
Antigüedad: 17 años, 9 meses
Puntos: 2
Respuesta: Buscador web no funciona an el servidor remoto

Hola, muchas gracias por tu respuesta. No me arroja ningun error, de hecho en local me funciona perfectamente.. y en remoto simplemente no muestra nada.. pero no da errores.. no se si sera algo a la hora de declarar variables..
Te explico un poco como esta montado:
En la pagina dodne se realiza la busqueda hay 2 cajas de texto..para buscar por Nombre o DNI.. y hay declarados 3 radiobutton que habra que seleccionar segun se quiera buscar por la palabra exacta, empieza o termina.
En la pagina dodne deberia mostarr el resultado es la siguiente:

<?php require_once('Connections/conexion.php'); ?>
<?php session_start();?>
<?php $dni = $_POST['dni']; ?>
<?php $nombre = $_POST['nombre']; ?>
<?php $valor = $_POST['valor'];?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_conexion, $conexion);
$query_busquedanombre = "SELECT * FROM clientes WHERE Nombre = '$nombre'";
$busquedanombre = mysql_query($query_busquedanombre, $conexion) or die(mysql_error());
$row_busquedanombre = mysql_fetch_assoc($busquedanombre);
$totalRows_busquedanombre = mysql_num_rows($busquedanombre);

mysql_select_db($database_conexion, $conexion);
$query_empieza = "SELECT * FROM clientes WHERE Nombre like '$nombre%'";
$empieza = mysql_query($query_empieza, $conexion) or die(mysql_error());
$row_empieza = mysql_fetch_assoc($empieza);
$totalRows_empieza = mysql_num_rows($empieza);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE7.js" type="text/javascript"></script>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Busqueda de clientes - DoctorCoche.es</title>
<link href="css2.css" rel="stylesheet" type="text/css" />
<style type="text/css">body {
background-image: url(imagenes/fondo.jpg);
}
</style>
</head>

<body>

<div id="contenido" align="center">
<div id="arriva">
</div>
<div id="principal">
<div id="barralogo">
</div>
<div id="fondologo">
<div id="drcoche">Dr.Coche
</div>
<div id="cruzlogo">
</div>
</div><!fondologo!>
<div id="textoslogos">
<div id="taller">Taller mecánico
</div>
<div id="lineadivi">
</div>
<div id="medico">El médico de su automóvil </div>
</div>

<div style="clear:both; height:20px;">
</div>
<div id="centralpanel">
<div id="bienvenido">
<div id="usuypas">
<div class="usu">Usuario:
</div>
<div class="pas"><?php echo $row_busquedanombre['usuario']; ?>
</div>
<div class="con">Contraseña:
</div>
<div class="pas"><?php echo $row_busquedanombre['contrasena']; ?>
</div>
</div>
</div>
<div id="volver"><a href="buscadorclientes.php">Volver</a> </div>
<div style="clear:both; height:30px;"></div><?php echo $valor ?>
<div id="buscli">
<?php
if ($valor == 'exacta')
{
?>
<table border="0" cellpadding="3" cellspacing="2">
<tr>
<td class="estilocelda">Nombre</td>
<td class="estilocelda">Apellidos</td>
<td class="estilocelda">DNI</td>
<td class="estilocelda">Poblacion</td>
<td class="estilocelda">Telefono</td>
<td class="estilocelda">Correo</td>
<td class="estilocelda">Matricula</td>
</tr>
<?php do { ?>
<tr class="estilo">
<td><?php echo $row_busquedanombre['Nombre']; ?></td>
<td><?php echo $row_busquedanombre['Apellidos']; ?></td>
<td><?php echo $row_busquedanombre['DNI']; ?></td>
<td><?php echo $row_busquedanombre['Poblacion']; ?></td>
<td><?php echo $row_busquedanombre['Telefono']; ?></td>
<td><?php echo $row_busquedanombre['Correo']; ?></td>
<td><a href="detallenombre.php?Matricula=<?php echo $row_busquedanombre['Matricula']; ?>"><?php echo $row_busquedanombre['Matricula']; ?></a></td>
</tr>
<?php } while ($row_busquedanombre = mysql_fetch_assoc($busquedanombre)); ?>
</table>
<p>
<?php
}
?>
</p>
<p>&nbsp; </p>

<?php
if ($valor == 'empieza')
{
?>
<table border="0" cellpadding="3" cellspacing="2">
<tr>
<td class="estilocelda">Nombre</td>
<td class="estilocelda">Apellidos</td>
<td class="estilocelda">DNI</td>
<td class="estilocelda">Poblacion</td>
<td class="estilocelda">Telefono</td>
<td class="estilocelda">Correo</td>
<td class="estilocelda">fechainscrip</td>
</tr>
<?php do { ?>
<tr class="estilo">
<td><?php echo $row_empieza['Nombre']; ?></td>
<td><?php echo $row_empieza['Apellidos']; ?></td>
<td><?php echo $row_empieza['DNI']; ?></td>
<td><?php echo $row_empieza['Poblacion']; ?></td>
<td><?php echo $row_empieza['Telefono']; ?></td>
<td><?php echo $row_empieza['Correo']; ?></td>
<td><?php echo $row_empieza['fechainscrip']; ?></td>
</tr>
<?php } while ($row_empieza = mysql_fetch_assoc($empieza)); ?>
</table>
<?php
}
?>
</div>
</div>
</div>
</div>
</div><!contenido!>


</body>
</html>

Hay 2 "if" para que muestre unos u otros resultados dependiendo de si se selecciono "empieza" o "exacta"... ("termina" lo he quitado para hacer pruebas")
Como digo este codigo me funciona perfectamente en local pero no muestra nada en remoto.