Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/01/2014, 02:12
hectorsales
 
Fecha de Ingreso: octubre-2013
Ubicación: Castellón de la Plana
Mensajes: 9
Antigüedad: 10 años, 6 meses
Puntos: 0
Script: Formulario-estilo

Hola a tod@s, tengo un problema en un script que no acaba de salirme correctamente, el script consiste mediante un formulario presentar un texto en pantalla con la opción de editarlo y modificar el formato de letra utilizando los estilos.

El resultado del script debe ser más o menos este:




Para ello creo el siguiente código:

Código PHP:
<html>
<head>
<title>Ejercicio_3</title>
</head>
<body>
<?php
if (isset($_REQUEST['aceptar']))
{
$marcado=$_REQUEST['marcado'];
$texto=$_REQUEST['texto'];
} else
{
$texto='Lorem Ipsum Dolor Sit Amet';
$marcado=$texto;
} echo 
"<p style='$marcado'>$texto</p>";
?>
<hr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'?>">
Introduce el texto a mostrar:
<input type="text" name="texto" value="<?php echo $texto ?>">
<br>
Estilo del texto:
<input type="checkbox" name="marcado" value="bold" <?php if ($marcado=='bold') echo 'checked' ?> > Negrita
<br>
<br>
<input type="submit" name="aceptar" value="Aceptar">
</form>
</body>
</html>

Al ejecutar el script obtengo lo siguiente:





Como puede verse al seleccionar el checkbox el texto no pasa a negrita..Los otros campos cursiva y subrayado no los he incluido..de momento

Alguien me puede echar una mano..

Saludos y Feliz Año a tod@s