diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b847dc58..3c777a2e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,6 +2,7 @@ # [Choice] PHP version (use -bullseye variants on local arm64/Apple Silicon): 8, 8.0, 7, 7.4, 7.3, 8-bullseye, 8.0-bullseye, 7-bullseye, 7.4-bullseye, 7.3-bullseye, 8-buster, 8.0-buster, 7-buster, 7.4-buster, 7.3-buster ARG VARIANT=7-bullseye FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT} +RUN docker-php-ext-install mysqli pdo_mysql # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 ARG NODE_VERSION="none" diff --git a/README.md b/README.md index 46e2e3c5..ecb16e3a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ Some things to try: - Press F5 to launch the app in the container. - Once the breakpoint is hit, try hovering over variables, examining locals, and more. 1. **Running a server:** - - From the terminal, run `php -S 0.0.0.0:8000` + -php -S 0.0.0.0:8000 From the terminal, run ``php -S 0.0.0.0:8000 +` - Click "Open in Browser" in the notification that appears to access the web app on this new port. - You can view an organized table of your forwarded ports in the 'Ports' view, which can be accessed with the command **Ports: Focus on Ports View**. - Notice port 8000 in the 'Ports' view is labeled "Hello Remote World." In `devcontainer.json`, you can set `"portsAttributes"`, such as a label for your forwarded ports and the action to be taken when the port is autoforwarded. diff --git a/practicas/Proyecto 1 Escape Room/config.php b/practicas/Proyecto 1 Escape Room/config.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/estilos.css b/practicas/Proyecto 1 Escape Room/estilos.css new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/finish.php b/practicas/Proyecto 1 Escape Room/finish.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/functions.php b/practicas/Proyecto 1 Escape Room/functions.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/header.php b/practicas/Proyecto 1 Escape Room/header.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/index.php b/practicas/Proyecto 1 Escape Room/index.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/room.php b/practicas/Proyecto 1 Escape Room/room.php new file mode 100644 index 00000000..e69de29b diff --git a/practicas/Proyecto 1 Escape Room/uploads b/practicas/Proyecto 1 Escape Room/uploads new file mode 100644 index 00000000..e69de29b diff --git a/practicas/mini-wp2/README.TXT b/practicas/mini-wp2/README.TXT new file mode 100644 index 00000000..f0029287 --- /dev/null +++ b/practicas/mini-wp2/README.TXT @@ -0,0 +1,7 @@ +Primera pagina: formulario para iniciar session login.php +si pasa, nos llevara a index.php +y de ahi nos tiene que saludar desde un personajes.php +y no mostrara un formulario que nos pedira nuestro personaje favorita + +y en otra pagina se tendrá que ver el personaje y para cerrar sesion logout.php +header.php, el header.php debe aparecer en index.php y y en personajes.php, ese header sera dinamico diff --git a/practicas/mini-wp2/data.php b/practicas/mini-wp2/data.php new file mode 100644 index 00000000..a4ff04b4 --- /dev/null +++ b/practicas/mini-wp2/data.php @@ -0,0 +1,49 @@ + 'Noticia 1', + 'contenido' => 'Contenido de la noticia 1', + 'fecha' => '2024-10-01', + 'imagen' => 'https://via.placeholder.com/150', + 'categoria' => 'Tecnología' + ], + [ + 'titulo' => 'Noticia 2', + 'contenido' => 'Contenido de la noticia 2', + 'fecha' => '2024-10-02', + 'imagen' => 'https://via.placeholder.com/150', + 'categoria' => 'Salud' + ], + [ + 'titulo' => 'Noticia 3', + 'contenido' => 'Contenido de la noticia 3', + 'fecha' => '2024-10-03', + 'imagen' => 'https://via.placeholder.com/150', + 'categoria' => 'Deportes' + ], + [ + 'titulo' => 'Noticia 4', + 'contenido' => 'Contenido de la noticia 4', + 'fecha' => '2024-10-04', + 'imagen' => 'https://via.placeholder.com/150', + 'categoria' => 'Cultura' + ], + [ + 'titulo' => 'Noticia 5', + 'contenido' => 'Contenido de la noticia 5', + 'fecha' => '2024-10-05', + 'imagen' => 'https://via.placeholder.com/150', + 'categoria' => 'Economía' + ] + ]; +} + +// Fin de data.php +?> diff --git a/practicas/mini-wp2/form.php b/practicas/mini-wp2/form.php new file mode 100644 index 00000000..f8e287d5 --- /dev/null +++ b/practicas/mini-wp2/form.php @@ -0,0 +1,114 @@ + $titulo, + 'contenido' => $contenido, + 'fecha' => $fecha, + 'imagen' => $imagen, + 'categoria' => $categoria + ]; + + // ------------------------------ + // 5. MOSTRAMOS MENSAJE DE ÉXITO + $mensaje = "
Noticia añadida correctamente.
"; + + } else { + // ------------------------------ + // 6. MENSAJE DE ERROR SI ALGÚN CAMPO ESTÁ VACÍO + $mensaje = "Error: Todos los campos son obligatorios.
"; + } +} +// Fin del bloque POST +?> + +, , el menú y el inicio del +include 'inc/header.php'; +?> + +