Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/10/2011, 09:00
campussummertime
 
Fecha de Ingreso: octubre-2011
Mensajes: 129
Antigüedad: 12 años, 6 meses
Puntos: 1
Respuesta: creando la parte de configuracion en un buscador

Hoal pues te digo lo que he realizado siguiendo tutoriales que he encontrado, consigo que realize la búsqueda pero me gustaría por ejemplo que cuando sale el nombre y apellido de la persona coja y pueda redireccionar a su directorio personal (una carpeta con la variable $alias que contiene un índex.php) o esta parte se tenia que predefinir desde la bd?

A continuación dejo el codigo php

<?php require_once('Connections/localhost.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}

$colname_Recordset1 = "-1";
if (isset($_GET['buscador'])) {
$colname_Recordset1 = $_GET['buscador'];
}
mysql_select_db($database_localhost, $localhost);
$query_Recordset1 = sprintf("SELECT * FROM web WHERE name LIKE %s ORDER BY name ASC", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
$Recordset1 = mysql_query($query_Recordset1, $localhost) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<table width="955" border="0" cellpadding="10">
<tr>
<td><?php echo $row_Recordset1['name']; ?><?php echo $row_Recordset1['surname']; ?></td>
</tr>
<tr>
<td><?php echo $row_Recordset1['date']; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Dejo en negrita el campo que creo que se tiene que editar...