Tema: Ayuda con if
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/12/2010, 22:20
Arcana
 
Fecha de Ingreso: mayo-2010
Mensajes: 185
Antigüedad: 14 años, 9 meses
Puntos: 2
Respuesta: Ayuda con if

Gracias si funciono! Pero ahora tengo otro problema con otro if, tengo este if, pero no oculta el html

Código PHP:
 <html>
<head>
                                                                       <!--Thegabrieel1 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Thegabrieel1">
<title>Sistema de mensajes privador por Thegabrieel1</title>
<link href="estilo.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
if(isset($_GET["delete"])) {
    
$id $_GET["delete"];
    if(
mysql_query("DELETE FROM `mensajes-privados` WHERE id = '$id'")) {
        echo 
"<div id='bien'><img src='Imagenes/bien.png' /> El mensaje ha sido elimiando con éxito</div>";
        } else { 
        echo 
"<div id='error'><img src='Imagenes/error.png' /> El mensaje no puedo ser elimiando. Vuelve a intentarlo en unos minutos</div>";
        }
    }
?>
<div class='mensajes'>
<?php
if($_SESSION[level] == or $_SESSION[level] == 3){
    echo 
"<div id='error'><img src='Imagenes/error.png' /> Debes ingresar para poder enviar mensajes</div>";showFrom();
}
else {
showFrom();
}
?>
<?php 
function showFrom() { ?>
<div class='carpeta'><strong>Carpeta: inbox </strong></div>
<div class='espacio'>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div class='menu'><strong><a href="index.php"><img src="Imagenes/recibido.gif" width="18" height="13" border="0"> Mensajes recibidos </a></strong><br>
<br>
<strong><a href="redactar.php"><img src="Imagenes/escribir.gif" width="17" height="17" border="0"> Escribir mensaje</a></strong></div>
<div class='leer'>
  <?php
$user 
$_SESSION['usuario'];
$q "SELECT * FROM `mensajes-privados` WHERE para = '$user' ORDER BY id DESC";
if(!(
$result_set mysql_query($q))) die(mysql_error());
$number mysql_num_rows($result_set);

if (
$number) {

  while (
$row mysql_fetch_array($result_set)) 
  {
     
$mid[] = $row['id'];
     
$mde[] = $row['de'];
     
$masunto[] = $row['asunto'];
     
$mleido[] = $row['leido'];
     
  }

  
  
$max_show 5;
         
  if (isset(
$_GET["page"]))
     
$page $_GET["page"];   
  else
     
$page 1;


  
  
$from2 $page $max_show;
  if (
$from2 $number)
  {
      
$diff $number &#37; $max_show;
      
$from2 $number;
      
$from1 $from2 $diff;
  }     
  else
      
$from1 $from2 $max_show;


  echo 
"<table border='1' width=550px style='FONT-SIZE: 12px;'><tr height=50>";
     echo 
"<td> </td> 
           <td> <b><u>Remitente</u></b></td> 
           <td> <b><u>Asunto</u></b></td>
           <td> <b><u>Leido</u></b></td>
           <td> <b><u>Acción</u></b></td></tr>"
;


  for (
$i=$from1$i $from2$i++) {
     
       echo 
"<tr>";  
       echo 
"<td> <a href=\"leer.php?id={$mid[$i]}\"><img src='Imagenes/mensaje-abierto.gif' border='0'> Leer</a></td>
       <td> {$mde[$i]}</td>
       <td> {$masunto[$i]}</td>
       <td> {$mleido[$i]}</td>
       <td>  <a href=\"index.php?delete={$mid[$i]}\"><img src='Imagenes/borrar.png'></a></b></td>"
;
  }

  echo 
"</tr></table>";
  echo 
"<br><br><table width='550px' border='0'><tr>";
  echo 
"<td align='right' width='50%'>&nbsp;";

  if (
$from1 0)
  {
     
$previous $page 1;
     echo 
"<a href='index.php?page=$previous'><< Página anterior</a>";
  } echo 
"</td>";


  echo 
"<td align=left width=50%>&nbsp;&nbsp;&nbsp;";
  if (
$from2 $number)
  {
     
$next $page 1;
     echo 
"<a href='index.php?page=$next'>Página siguiente >></a>";
  } echo 
"</td></tr></table>";

  
  
}
else 
  echo 
"<strong>No tienes ningún mensaje.</strong>";
}
?>
</div>
</div>
</body>
</html>

Esta es la parte que no oculta:

<div class='carpeta'><strong>Carpeta: inbox </strong></div>
<div class='espacio'>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div class='menu'><strong><a href="index.php"><img src="Imagenes/recibido.gif" width="18" height="13" border="0"> Mensajes recibidos </a></strong><br>
<br>
<strong><a href="redactar.php"><img src="Imagenes/escribir.gif" width="17" height="17" border="0"> Escribir mensaje</a></strong></div>
<div class='leer'>

Última edición por Arcana; 09/12/2010 a las 22:48