Lo he vuelto a dejar como estaba y con los cambios que me has dicho pero, no va:
Código PHP:
<?php
error_reporting(E_ALL^E_NOTICE);
include('pagination_class.php');
mysql_connect('localhost', 'user', 'pass') or die(mysql_error());
mysql_select_db('db');
mysql_query("SET NAMES 'utf8'");
$headers = "Content-type: text/html; charset=UTF-8";
?>
<script language="JavaScript" src="pagination.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<?
//ESTA ES LA ESTRUCTURA DEL BUSCADOR EN LA DB. UTILIZA LA VARIABLE "search_text".
$qry = "SELECT * FROM clientes ";
$searchText = "";
if($_REQUEST['search_text']!=""){
$searchText = $_REQUEST['search_text'];
$qry .=" where ID like '$searchText%'
or nombre like '$searchText%'
or apellidos like '$searchText%'
or empresa like '$searchText%'
or ciudad like '$searchText%'
or telefono like '$searchText%'
or email like '$searchText%'
or fecha like '$searchText%'";
echo $qry;
}
//para la paginación
$starting=0;
$recpage = 20;//número de registros por página
$obj = new pagination_class($qry,$starting,$recpage);
$result = $obj->result;
?>
<!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">
<style type="text/css">
<!--
body {
background-color: #FCEBD1;
}
.Estilo1 {color: #7A9801}
.Estilo2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #333333;
font-weight: bold;
font-size: 13px;
}
-->
</style><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Prueba Base Libros</title>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<body>
<script language="JavaScript">
function confirmar(url){
if (!confirm("¿Estás seguro de que deseas eliminar el registro?")) {
return false;
}
else {
document.location= url;
return true;
}
}
</script>
<form name="form1" action="basedatos.php" method="POST">
<table border="0" align="center" width="1024">
<tr>
<TD colspan="2" rowspan="3"><img src="images/cabecera.jpg" alt="ImgCabecera" width="642" height="113" /></TD>
<TD width="12%" colspan="-1"> </TD>
</tr>
<tr>
<TD colspan="-1"> </TD>
</tr>
<tr>
<TD colspan="-1"> </TD>
</tr>
<tr>
<TD colspan="3"> </TD>
</tr>
<tr>
<TD width="37%">
<span class="Estilo2">Buscar</span>
<input type="text" name="search_text" value="<?php echo ($searchText); ?>"/><input type="submit" value="Buscar" /></TD>
<TD width="51%"><span class="Estilo1"><a href="basedatos.php" class="link">Reiniciar </a>|<a href="ingresar.php" class="a:link"> Nuevo Registro </a>| <a href="exel.php" class="link"> Exportar a Excel</a></span></TD>
<TD> </TD>
</tr>
<tr><TD colspan="3">
<div id="page_contents">
<table border="0" align="center" width="100%">
<tr class="titulos">
<td width="17">Id</td>
<td width="68">Nombre</td>
<td width="140">Apellidos</td>
<td width="140">Empresa</td>
<td width="101">Ciudad</td>
<td width="95">Teléfono</td>
<td width="181">E-mail</td>
<td width="69">Fecha</td>
<td colspan="2">Operaciones</td>
</tr>
<?
if(mysql_num_rows($result)!=0){
$counter = $starting + 1;
while($data = mysql_fetch_array($result)) {
$headers = "Content-type: text/html; charset=UTF-8";
?>
<tr class="letra_y_fondo_consulta">
<td><? echo utf8_encode($data['ID']); ?></td>
<td><? echo utf8_encode($data['nombre']); ?></td>
<td><? echo utf8_encode($data['apellidos']); ?></td>
<td><? echo utf8_encode($data['empresa']); ?></td>
<td><? echo utf8_encode($data['ciudad']); ?></td>
<td><? echo utf8_encode($data['telefono']); ?></td>
<td><? echo utf8_encode($data['email']); ?></td>
<td><? echo utf8_encode($data['fecha']); ?></td>
<td width="35"><a href="modificar.php?ID=<?php echo $data['ID']; ?>">Modif</a></td>
<td width="35"><a href="javascript:;"onclick="confirmar('borrar.php?ID=<?php echo $data['ID']; ?>'); return false;">Elim</a></td>
</tr>
<?
}
?>
<tr>
<td colspan="4"><? echo $obj->anchors; ?></td>
</tr>
<tr>
<td colspan="4"><? echo $obj->total; ?></td>
</tr>
<?
}else{
?>
<tr>
<td align="center" colspan="4">No hay datos disponibles</td>
</tr>
<?
}
?>
</table>
</div>
</TD></tr>
</table>
<h6> </h6>
</form>
</body>
</html>