Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/12/2010, 19:46
Avatar de thestreamsound
thestreamsound
 
Fecha de Ingreso: diciembre-2010
Mensajes: 16
Antigüedad: 13 años, 5 meses
Puntos: 0
Ayuda con constructor

Hola a todos. Estoy desarrollando un sistemita que habia hecho anteriormente no orientado a objetos y lo estoy convirtiendo a OO.
El problema es que no me aparece nada cuando cargo esa pagina cuando hago la clase y el constructor, si los quito funciona perfectamente. Alguien me puede decir por favor en que me estoy equivocando.? Soy nueva en php orientada a objetos asi que tengan un poco de paciencia conmigo. Ya habia hecho otras clases y las mandaba llamar y si funcionaba pero esta no funciona. Iluminenme !!! Muchisimas gracias

Aqui esta mi coddigo

Código PHP:
<?php 
class GUIanun{

function 
GUIanun(){
echo 
"AQUI";
$this->Anuncios();
}

function 
Anuncios(){
?>

<html><head>

 <SCRIPT type="text/javascript" SRC="include/js/popup_main.js">
</SCRIPT>   

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">    


  <title>Leer Mensajes</title>

  <link href="include/css/estilos.css" rel="stylesheet" text="text/css">
</head><body leftmargin="0" topmargin="0" bgcolor="white" marginheight="0" marginwidth="0">

       



<table cellpading="0" border="0" cellspacing="0" style="width: 650px">
     <tbody><tr bgcolor="#4665b5">
      <td height="25"><font color="white">&nbsp;</font></td>
      <td align="right"><table cellpading="0" border="0" cellspacing="0"><tbody><tr align="center">
                <td align="center">
                
              
                <a href="javascript:window.close();" class="blanco"><img src="imagenes/cerrar.gif" border="0"><br><font color="white">
                <span class="style2">Cerrar</span></font></a>&nbsp;&nbsp;&nbsp;</td>
     
      </tr>
      </tbody></table>
      </td>
     </tr>
</tbody></table>

<table bgcolor="#e4ecf6" border="0" cellpadding="0" cellspacing="0" width="650">
  <tbody><tr><td> 
     <table bgcolor="#f9f9f9" border="0" cellpadding="2" cellspacing="0" width="650" height="300">
      <tbody><tr>
      
 <td style="width: 38%; height: 83px;" class="style2" valign="top">
               <?php
$conexion
=mysql_connect("127.0.0.1","root","") or 
  die(
"Problemas en la conexion");
mysql_select_db("an",$conexion) or
  die(
"Problemas en la selección de la base de datos");
$registros=mysql_query("select idanuncio,idusuario, idattach, idfoto, fecha, titulo, descrip, tipo, validez
                       from anuncio where idanuncio='$_GET[pos]'"
,$conexion) or
  die(
"Problemas en el select:".mysql_error());
//en vez de request se usa GET para pasar parametros
if ($reg=mysql_fetch_array($registros))
{
if (
$reg['idattach']!= ""
{
?>  
  
<b>Archivo Adjunto: </b><br><br>
 <a href="cal_redac/fotos/<?php echo $reg['idattach'] ;?>">cal_redac/fotos/<?php echo $reg['idattach'] ;?></a>&nbsp;</td>
       <td align="right" class="style2" valign="top" style="width: 10%; height: 83px">
<?php }else {
echo 
"<b>No hay archivo adjunto </b><br><br>";
 } 
?>     
      
<?php
  
echo "<td bgcolor=\"white\" class=\"style2\" style=\"width: 400px\" valign=\"top\">";
  echo 
"<b>ID: </b>".$reg['idanuncio']."<br>";
  echo 
"<b>De:</b> ".$reg['idusuario']."<br><br>";
  echo 
"<b>Título: </b><br>".$reg['titulo']."<br><br>";
  echo 
"<td bgcolor=\"white\" class=\"style2\" style=\"width: 265px\" valign=\"top\">";
  echo 
"<b>Datos sobre el Anuncio: </b><br>";
  echo 
"<b>Fecha de Creación: </b>".$reg['fecha']."<br>";
  echo 
"<b>Disponible hasta: </b>".$reg['validez']."<br><br><br>";
  echo 
"</td><td>&nbsp;</td>";
?>


</td>
      </tr>
   <!--    <tr>
      <td align="right" style="width: 38%" class="style2">&nbsp;</td>
       <td align="right" class="style2">&nbsp;</td><td class="style2">&nbsp;</td> 
      </tr> -->
      <tr>
       <td style="width: 38%" class="style1" valign="top">
       
       <span class="style2">
<?php if ($reg['idfoto']!= ""
{
?>              
       <b>Fotografía: </b>
       
       </span><span class="style5"><span class="style3"><br>
        <br>
       
       
   
       &nbsp;<a href="javascript:PopupPic('cal_redac/fotos/<?php echo $reg['idfoto'] ;?>')">
       <img src="cal_redac/fotos/<?php echo $reg['idfoto'] ;?>" width="189" height="159" class="style7" alt="No se encontró imagen"></a><br>
        </span><span class="style6">
        Dé clic en la imagen para agrandar</span></span></td>
<?php ?>       
       
       
       <td colspan="3" class="style4" valign="top">


<?php
echo"<b>Descripción:</b><br>";
echo 
"".$reg['descrip']."<br>";

}
else
{
  echo 
"Anuncio Inválido";
}
mysql_close($conexion);
?>


       
       
       
      </td>
      </tr>
      <tr><td bgcolor="white" style="width: 38%" class="style2" valign="top">&nbsp;</td>
           <td bgcolor="white" class="style2" valign="top" style="width: 10%">&nbsp;</td>
       <td bgcolor="white" class="style2" valign="top">
            &nbsp;</td> 
      </tr> 
     </tbody></table>
     </td></tr><tr align="right" height="25">
    
     <td colspan="2"> 
        <a href="javascript:window.close();" class="blanco" style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"><font color="blue">Cerrar</font></a></td>
      </tr>
  
 </tbody></table> 
</body></html>

<?php  }}//fin class?>