Editor PHP (Sección 1)
<?php // Formulario con modal dinámico ?> <form id="dynamicForm" style="margin: 20px; display: flex; flex-direction: column; gap: 10px; max-width: 300px;"> <label style="color: #d4d4d4;">Usuario: <input type="text" name="user" style="padding: 5px; border-radius: 4px;"></label> <label style="color: #d4d4d4;">Contraseña: <input type="password" name="pass" style="padding: 5px; border-radius: 4px;"></label> <button type="submit" style="padding: 8px; background: #0e639c; color: white; border: none; border-radius: 4px;">Login</button> </form> <div id="modal" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); justify-content: center; align-items: center;"> <div style="background: #252526; padding: 20px; border-radius: 8px; text-align: center; max-width: 400px; width: 90%; color: #d4d4d4;"> <h3>Hola, bienvenido</h3> <p>¡Tu formulario ha sido enviado!</p> <button onclick="document.getElementById('modal').style.display='none'" style="padding: 8px; background: #0e639c; color: white; border: none; border-radius: 4px;">Cerrar</button> </div> </div> <script> document.getElementById("dynamicForm").addEventListener("submit", function(e) { e.preventDefault(); document.getElementById("modal").style.display = "flex"; }); </script>
▶ Ejecutar
🗑 Limpiar
Listo
Salida (Sección 2)
Escribe tu código PHP y haz clic en Ejecutar...