¿cómo estás?
Quiero estructurar mi código con el mayor cuidado posible, pero no sé cómo hacerlo. En un solo archivo, tengo código PHP, JS y HTML y me preguntaba si era posible separar los contenidos al incluir su "ruta" en el código html.
Por ejemplo, cómo puedo separar el código php y el código js:
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> { js code } { php code } </body> </html>``` Thank you in advance for the information I would receivePuede usar el archivo '.php' como predeterminado y luego simplemente poner html en eso
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <script src="file.js"></script> <?php include('file.php') ?> </body> </html>