diff --git a/README.md b/README.md index 654a6a1..5bd80cf 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,30 @@ -`#php` `#server` `#master-in-software-development` +# PHP Server Environment 💻 -# PHP Server Environment +> In this project we learnt how to explore the content of the variable $_SERVER which is injected to the running script, in it we can find information about the server environment and the client as well as creating a simple login form that validates the inputs, throws alerts for different cases and that can logout successfully. +For this I used session_start() to maintain the variables as well as: unset($_SESSION), session_destroy() and session_write_close() to logout. -

- Version -

+I also used Bootstrap to create a simple and beautiful layout and desing. -> In this project you will learn how to explore the content of the variable $_SERVER which is injected to the running script, in it we can find information about the server environment and the client. - -## Index +## Index ☟ - [Requirements](#requirements) -- [Repository](#repository) - [Technologies used](#technologies-used) -- [Project delivery](#project-delivery) - [Resources](#resources) -## Requirements +## Requirements - Learn how to use the $_SERVER - Understand what a server-side language is and what it is used for +- Learn how to handle errors +- Learn how to use Sessions -## Repository - -First of all you must fork this project into your GitHub account. - -To create a fork on GitHub is as easy as clicking the “fork” button on the repository page. - -Fork on GitHub - -## Technologies used +## Technologies used \* PHP +\* XAMPP +\* Bootstrap -## Project delivery - -To deliver this project you must send a Pull Request as explained in the Students Handbook. Remember that the PR title must be with the format -- Solution: + NAME AND SURNAME or TEAM NAMES AND SURNAMES. -- For example: "Solution: Josep Riera", "Solution: Josep Riera, Toni Suárez, Marta Vázquez" - -## Resources +## Resources 👀 - [$_SERVER](https://www.php.net/manual/en/reserved.variables.server.php) - [PHP.ini](https://www.php.net/manual/es/configuration.file.php) diff --git a/loginExercise/close_session.php b/loginExercise/close_session.php new file mode 100644 index 0000000..2bca065 --- /dev/null +++ b/loginExercise/close_session.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/loginExercise/index.php b/loginExercise/index.php new file mode 100644 index 0000000..7312570 --- /dev/null +++ b/loginExercise/index.php @@ -0,0 +1,93 @@ + + + + + + + + + + + + + Password must be at least 8 characters and must contain at least one lower case letter, one upper case letter and one digit

'; + // } else { + // echo "The form has been submitted"; + // } + // } + ?> +
+ +

Log In

+ + + Logged out successfully.
"; + } + } + ?> + + + + + + + + +
+
+ + +
+ +
+ + +
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/loginExercise/panel.php b/loginExercise/panel.php new file mode 100644 index 0000000..e1105aa --- /dev/null +++ b/loginExercise/panel.php @@ -0,0 +1,29 @@ + + + + + + + + + + + PRIVATE ZONE + + +
+ +

PRIVATE ZONE

+ Logout + +
+ + + \ No newline at end of file diff --git a/loginExercise/validate.php b/loginExercise/validate.php new file mode 100644 index 0000000..bf2b8b2 --- /dev/null +++ b/loginExercise/validate.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/server_variables.php b/server_variables.php new file mode 100644 index 0000000..0eefb80 --- /dev/null +++ b/server_variables.php @@ -0,0 +1,9 @@ +"; + +print_r($_SERVER); + +echo ""; + +?> \ No newline at end of file diff --git a/session_variables.php b/session_variables.php new file mode 100644 index 0000000..2f541ac --- /dev/null +++ b/session_variables.php @@ -0,0 +1,13 @@ +"; +print_r($_SESSION); +echo ""; + +?> \ No newline at end of file