PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include 'config.php';
if (empty($email_busca)) {
viewheader();
echo '<h4>Olvido digitar el correo electrónico que desea consultar</h4>';
echo '<h4 style="text-align: center;"><a href="javascript:history.back()">Regresar</a></h4>';
viewfooter();
exit;
}
db_connect();
viewheader();
// separate out your SQL query - it'll make your life much easier in the long
// run.
$sql = "SELECT * FROM `$dbtable` WHERE `email1` LIKE '%{$_GET['email_busca']}%' LIMIT 10";
$res = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
// be consistent about where you place braces on your statements.
if (mysql_num_rows($res) < 1) {
echo '<p style="margin: 30 0 10 0;">ESTE CORREO ELECTRÓNICO NO HA SIDO REGISTRADO!!!!</p>';
echo '<h4><a href="javascript:history.back()">Regresar</a></h4>';
} else {
// you need to start the table here if you want it to contain all of the
// records, if you put the start in the while loop you'll get one table
// and heading per record
?>
<h4>ESTOS SON LOS DATOS DEL USUARIO CONSULTADO</h4>
<!-- be consistent about using either single or double quotes around
your HTML
use CSS properly - then you won't have to use tags anymore
and delete all your tags -->
<!-- your table tags were a bit messy - missing closing tags and
strangely nested tables, I've tried to clean it up but I'm not
sure how well it worked -->
<table width="80%" border="0" cellpadding="1" cellspacing="0" class="textfield2">
<tr bgcolor="#F6F6F6">
<td valign="top" align="right">
- <a href='menu.php'>REGRESAR</a> - - <a href='logout.php'>SALIR</a> -
</td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
<tr bgcolor="#F1F1F1">
<td valign="top" colspan="5"> </td>
</tr>
<tr bgcolor="#F6F6F6">
<th style="text-align: left;">Nombre</th>
<th style="text-align: left;">Email</th>
<th style="text-align: left;">Consultar</th>
<th>Mail</th>
<th>Seguimiento</th>
</tr>
<?php
// format your code - use tabs to make it easier to follow.
while ($row = mysql_fetch_assoc($res)) {
?>
<!-- where does the $bgColor variable come from? -->
<tr bgcolor="<?php echo $bgColor; ?>">
<td valign="top">
<b><?php echo $row['nombre']; ?> <?php echo $row['apellido1']; ?> <?php echo $row['apellido2']; ?></b>
</td>
<td valign="top">
<a href="mailto:<?php echo $row['email1']; ?>"><?php echo $row['email1']; ?></a>
</td>
<td>
<a href="fiche_membre1.php?id=<?php echo $row['id']; ?>" target="_blank" onMouseOver="status='Consultar Información del usuario'; return true;" onMouseOut="status='';">Consultar Información</a>
</td>
<td>
<div align="center"><a href="envio_mail.php?id=<?php echo $row['id']; ?>" target="_blank" onMouseOver="status='Ingresar'; return true;" onMouseOut="status='';">
<img src="checkbox.gif" width="18" height="18" border="0" />
</a></div>
</td>
<td>
<div align="center"><a href="seguimiento.php?id=<?php echo $row['id']; ?>" target="_blank" onMouseOver="status='Ingresar'; return true;" onMouseOut="status='';">
<img src="seg.gif" width="22" height="18" border="0" />
</a></div>
</td>
</tr>
<?php
} // end while
?>
</table>
</td>
</tr>
<tr bgcolor="#F6F6F6">
<td valign="top" align="right">
- <a href='menu.php'>REGRESAR</a> - - <a href='logout.php'>SALIR</a> -
</td>
</tr>
</table>
<?php
} // end if
?>