Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/05/2017, 17:00
Avatar de petit89
petit89
 
Fecha de Ingreso: marzo-2011
Mensajes: 1.135
Antigüedad: 13 años, 1 mes
Puntos: 170
Respuesta: Generar hoja de estilo css desde php

Ejemplo rapido

formulario.php
Código HTML:
Ver original
  1. <form action="resultado.php?ejecute=1" method="post">
  2. Color de Fondo: <input type="text" name="fondo" value="black">
  3. <input type="submit" value="enviar">


resultado.php
Código PHP:
Ver original
  1. <?php
  2. if(isset($_POST['fondo']) && !empty($_POST['fondo'])){
  3. $color_fondo = $_POST['fondo'];
  4. }
  5. ?>
  6. <html>
  7. <head>
  8. <style>
  9. body {
  10.     background-color: <?= $color_fondo; ?>;
  11. }
  12.  
  13. </style>
  14. </head>
  15. <body>
  16. </body>
  17. </html>
__________________
█ WebHosting / Reseller a bajo costo | Uptime Garantizado | Soporte en Español e Ingles
¿Te sirvió la respuesta? Deja un +1 (Triangulo negro al lado derecho)