Foros del Web » Programando para Internet » PHP »

Como puedo hacer esto?

Estas en el tema de Como puedo hacer esto? en el foro de PHP en Foros del Web. Tengo este código que me genera una página Código PHP: echo  "<html><head><title>Error en Datos</title></head> <style type=\"text/css\">     body{     scrollbar-face-color: #aaaaaa;      scrollbar-highlight-color: #aaaaaa;      scrollbar-shadow-color: #aaaaaa;      scrollbar-3dlight-color: #eeeeee;     scrollbar-arrow-color: #000000;      scrollbar-track-color: #e3e3e3;      scrollbar-darkshadow-color: #000000;     } TD { font-family: Tahoma; font-size: 11px; } TH { font-family: Tahoma; font-size: 13px; } TEXTAREA { border-bottom-width: 1px; border-color: #000000; border-left-width: 1px; ...
  #1 (permalink)  
Antiguo 17/05/2003, 12:53
Avatar de Reynier  
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 4 meses
Puntos: 1
Como puedo hacer esto?

Tengo este código que me genera una página

Código PHP:
echo "<html><head><title>Error en Datos</title></head>
<style type=\"text/css\">
    body{
    scrollbar-face-color: #aaaaaa; 
    scrollbar-highlight-color: #aaaaaa; 
    scrollbar-shadow-color: #aaaaaa; 
    scrollbar-3dlight-color: #eeeeee;
    scrollbar-arrow-color: #000000; 
    scrollbar-track-color: #e3e3e3; 
    scrollbar-darkshadow-color: #000000;
    }
TD { font-family: Tahoma; font-size: 11px; }
TH { font-family: Tahoma; font-size: 13px; }
TEXTAREA { border-bottom-width: 1px; border-color: #000000; border-left-width: 1px;
border-right-width: 1px; border-style: solid; border-top-width: 1px; font-family: Tahoma;
font-size: 10px; font-weight: bold; text-indent: 2px; }
INPUT { border-bottom-width: 1px; border-color: #000000; border-left-width: 1px;
border-right-width: 1px; border-top-width: 1px; color: #000000; font-family: Tahoma; 
font-size: 10px; font-weight: normal; text-indent: 2px; }
SELECT { background-color: #DFF4FF; font-family: Tahoma; font-size: 10px;
font-weight: bold; }
A:link { background-color: transparent; color: #215D83;
font-family: Tahoma; font-size: 11px; text-decoration: none; }
A:visited { background-color: transparent; color:  
</style>
<body background=\"img/back.gif\" leftmargin=\"0\" topmargin=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr> 
          <td><img src=\"img/error.gif\" width=\"653\" height=\"132\"></td>
        </tr>
        <tr> 
          <td>Tienes los siguientes errores en tus datos:</td>
        </tr>
        <tr> 
          <td>echo</td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>"
;
?> 
dentro de esta va este otro codigo
Código PHP:
 if (condicion)
 echo 
"Algo"
y quiero que esto se me imprima dentro de la tabla que he creado antes arriba ¿cómo lo puedo hacer?

Salu2
__________________
Ing. Reynier Pérez Mira
  #2 (permalink)  
Antiguo 17/05/2003, 13:25
 
Fecha de Ingreso: noviembre-2002
Ubicación: Barcelona - España
Mensajes: 270
Antigüedad: 21 años, 4 meses
Puntos: 0
Por lo que veo tienes mal el script. No empieza con <? y tampoco se ve cuando lo separas, si está tal como aparece no podrías cerrar body ni nada de eso.
  #3 (permalink)  
Antiguo 17/05/2003, 13:38
 
Fecha de Ingreso: marzo-2003
Mensajes: 277
Antigüedad: 21 años, 1 mes
Puntos: 0
Re: Como puedo hacer esto?

tienes algunos problemas con los codigos
te recomiendo que en ves del codigo principal pon esto


Código PHP:
<?php 

if(condicion){
$variable "ALGO";
}
?>

<html><head><title>Error en Datos</title></head>
<style type=\"text/css\">
    body{
    scrollbar-face-color: #aaaaaa; 
    scrollbar-highlight-color: #aaaaaa; 
    scrollbar-shadow-color: #aaaaaa; 
    scrollbar-3dlight-color: #eeeeee;
    scrollbar-arrow-color: #000000; 
    scrollbar-track-color: #e3e3e3; 
    scrollbar-darkshadow-color: #000000;
    }
TD { font-family: Tahoma; font-size: 11px; }
TH { font-family: Tahoma; font-size: 13px; }
TEXTAREA { border-bottom-width: 1px; border-color: #000000; border-left-width: 1px;
border-right-width: 1px; border-style: solid; border-top-width: 1px; font-family: Tahoma;
font-size: 10px; font-weight: bold; text-indent: 2px; }
INPUT { border-bottom-width: 1px; border-color: #000000; border-left-width: 1px;
border-right-width: 1px; border-top-width: 1px; color: #000000; font-family: Tahoma; 
font-size: 10px; font-weight: normal; text-indent: 2px; }
SELECT { background-color: #DFF4FF; font-family: Tahoma; font-size: 10px;
font-weight: bold; }
A:link { background-color: transparent; color: #215D83;
font-family: Tahoma; font-size: 11px; text-decoration: none; }
A:visited { background-color: transparent; color:  
</style>
<body background=\"img/back.gif\" leftmargin=\"0\" topmargin=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr> 
          <td><img src=\"img/error.gif\" width=\"653\" height=\"132\"></td>
        </tr>
        <tr> 
          <td>Tienes los siguientes errores en tus datos:</td>
        </tr>
        <tr> 
          <td>[COLOR=red]<?php echo "$variable"?>[/COLOR] td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
salu2

Última edición por kech; 17/05/2003 a las 13:41
  #4 (permalink)  
Antiguo 17/05/2003, 13:53
Avatar de Reynier  
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 4 meses
Puntos: 1
Gracias

Gracias ya me dio resultado
__________________
Ing. Reynier Pérez Mira
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:01.