Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/05/2008, 08:55
Avatar de ACX_POISON
ACX_POISON
 
Fecha de Ingreso: abril-2008
Ubicación: Talca-Chile
Mensajes: 750
Antigüedad: 16 años, 1 mes
Puntos: 7
Re: ayuda form + vista previa

Gracias X responder No puse el codigo completo pero este es:

Cita:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ingreso de Noticias</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:409px;
height:258px;
z-index:1;
left: 127px;
top: 148px;
}
.Estilo1 {
font-size: 24px;
font-weight: bold;
}
#Layer2 {
position:absolute;
width:364px;
height:286px;
z-index:2;
left: 127px;
top: 449px;
}
#Layer3 {
position:absolute;
width:48px;
height:30px;
z-index:2;
left: 496px;
top: 261px;
}
#Layer4 {
position:absolute;
width:51px;
height:36px;
z-index:2;
left: 496px;
top: 307px;
}
-->
</style>
</head>

<body>
<table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="justify">
<p><font color="#000066" size="5" face="Arial, Helvetica, sans-serif"><strong>Administrador<br />
</strong><font size="2"><br />
</font></font><font color="#000066" size="2" face="Arial, Helvetica, sans-serif"><br />
</font><font color="#000066" size="5" face="Arial, Helvetica, sans-serif"> </font></p>
</div></td>
</tr>
</table>

<div id="Layer1">
<form action="nueva1.php" method="post" enctype="multipart/form-data" name="frm" id="frm">
<table width="408" height="257" border="0">
<tr>
<td colspan="2"><div align="center" class="Estilo1">Ingrese Una Nueva Noticia </div></td>
</tr>
<tr>
<td width="178"><strong>Fecha:</strong></td>
<td width="220"><label>
dia<?
$dia_actual = date("d");



echo('<select name="fdia">');

for($i=1;$i<=31;$i++)
{

if($i==$dia_actual)
{
echo('<option value="'.$i.'" selected="selected">'.$i.'</option>');
}
else
{
echo('<option value="'.$i.'">'.$i.'</option>');
}

}

echo('</select>');
?>
mes
<?
$mes_actual = date("n");



echo('<select name="fmes">');

for($i=1;$i<=12;$i++)
{

if($i==$mes_actual)
{
echo('<option value="'.$i.'" selected="selected">'.$i.'</option>');
}
else
{
echo('<option value="'.$i.'">'.$i.'</option>');
}

}

echo('</select>');
?>
a&ntilde;o
<?
$anio_actual = date("Y");

$anios_anteriores = $anio_actual-5;
$anios_futuros= $anio_actual +5;

echo'<select name="fano">';

for($i=$anios_anteriores;$i<=$anios_futuros;$i++)
{
if($i==$anio_actual)
{
echo('<option value="'.$i.'" selected="selected">'.$i.'</option>');
}
else
{
echo('<option value="'.$i.'">'.$i.'</option>');
}

}

echo('</select>');
?>
</label></td>
</tr>
<tr>
<td><strong>Autor</strong></td>
<td><label>
<input name="fautor" type="text" id="fautor" />
</label></td>
</tr>
<tr>
<td><strong>Titulo:</strong></td>
<td><label>
<input name="ftitulo" type="text" id="ftitulo" />
</label></td>
</tr>
<tr>
<td><strong>Breve:</strong></td>
<td><label>
<textarea name="fbreve" id="fbreve"></textarea>
</label></td>
</tr>
<tr>
<td><strong>Noticia</strong></td>
<td><label>
<textarea name="fnoticia" rows="5" id="fnoticia"></textarea>
</label></td>
</tr>
<tr>
<td><strong>Imagen:</strong></td>
<td><label>
<input name="fimagen" type="file" id="fimagen" />
</label></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<label>
<input type="submit" name="Submit" value="Continuar&gt;&gt;" />
</label>
&nbsp;
<label>
<input type="reset" name="Submit2" value="Restablecer" />
</label>
</div></td>
</tr>
</table>
</form>
</div>
<?
if($_POST)
{
include("../../../funciones/funcion.php");
extract($_POST);
$error=0;
//var_dump(empty($fbreve));
//var_dump(empty($fnoticia));

if(empty($fbreve))
{
$error=1;
}
if(empty($fnoticia))
{
$error=2;
}
if((empty($fnoticia))and(empty($fbreve)))
{
$error=3;
}


if($error==0)
{

$fautor=str_inde($fautor,"Anonimo");
$ftitulo=str_inde($ftitulo,"Sin Titulo");
$fbreve=str_inde($fbreve);
$fnoticia=str_inde($fnoticia);
$fimagen=strip_tags($fimagen);

$src='src="'.$fimagen.'"';


echo"$fimagen <br>$src";

echo'
<div id="Layer2">
<form action="nueva2.php" method="post" name="frmX" id="frmX">
<table width="365" height="280" border="0">
<tr>
<td colspan="2"><div align="center">Confirnacion de datos Ingresados </div></td>
</tr>
<tr>
<td width="170"><strong>Fecha:</strong></td>
<td width="185">'.$fdia.'/'.$fmes.'/'.$fano.'
<input name="ocu_fecha" type="hidden" id="ocu_fecha" value="'.$fdia.'/'.$fmes.'/'.$fano.'" /></td>
</tr>
<tr>
<td><strong>Autor:</strong></td>
<td>'.$fautor.'
<input name="ocu_autor" type="hidden" id="ocu_autor" value="'.$fautor.'" /></td>
</tr>
<tr>
<td><strong>Titulo:</strong></td>
<td>'.$ftitulo.'
<input name="ocu_titulo" type="hidden" id="ocu_titulo" value="'.$ftitulo.'" /></td>
</tr>
<tr>
<td><strong>Breve:</strong></td>
<td>'.$fbreve.'
<input name="ocu_breve" type="hidden" id="ocu_breve" value="'.$fbreve.'" /></td>
</tr>
<tr>
<td><strong>Noticia</strong></td>
<td><label>
<textarea name="noticia" rows="8" disabled="disabled" id="noticia">'.$fnoticia.' </textarea>
<input name="ocu_noticia" type="hidden" id="ocu_noticia" value="'.$fnoticia.' " />
</label></td>
</tr>
<tr>
<td><strong>Imagen:</strong></td>
<td><img '.$src.' alt="imagen" width="50" height="50" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<label>
<input type="submit" name="Submit3" value="Continuar&gt;&gt;" />
</label>
</div></td>
</tr>
</table>
</form>
</div>';

}
elseif($error==1)
{
echo'
<div id="Layer3"><img src="../../BAses/Images/X.jpg" alt="No Valido" width="46" height="32" /></div>';
}
elseif($error==2)
{
echo'
<div id="Layer4"><img src="../../BAses/Images/X.jpg" alt="No Valido" width="46" height="32" /></div>';
}
elseif($error==3)
{
echo'<div id="Layer3"><img src="../../BAses/Images/X.jpg" alt="No Valido" width="46" height="32" /></div>
<div id="Layer4"><img src="../../BAses/Images/X.jpg" alt="No Valido" width="46" height="32" /></div>';
}



}
?>

</body>
</html>