Seventh Assignment | Introduction to JavaScript and Web Design

For this week we learned more about PHP. Specifically forms, requests, and files.

Our first task is to explain the different between the build in PHP variables $_GET and $_POST. Each of these holds the corresponding information for their respective request type. The difference lies in the purpose of the request methods, and they’re pretty verbose. GET should be used to get/retrieve information, so things like searching information or passing additional information along with a request. POST should be used when the data will create/change something on the server. GET requests are not as secure as POST requests and often do not require the complex levels of validation an POST request might since its not actually changing data.

Our next task was to create a form and response php file. Here was mine:

Here a get request is sent to the php file in the action attribute. The response reads the form data for a ‘name’ input and its corresponding value is put into a string that welcomes the name.