Forms and Databases Flashcards
What do the method and action attributes do in a form?
method: used to transmit data supplied by user - default method is get
action: used to specify where the form data is to be transmitted. Typically a file that contains the necessary code for processing the form data, and generates the desired output and displays it
Which of the GET or POST methods is recommended?
POST is recommended
GET is the default
How do POST and GET get a response from the server?
POST - submits data to a web server, receives response
GET - asks server for a page or data
Where do POST and GET append/store data?
POST - stores data within body of the request. Does not append to the URL.
GET - appends the info entered by the user to the URL in the form of name-value pairs. This is called a query string.
When should GET and POST be used?
POST - when data is going to result in a change to the server’s database
GET - when forms won’t change user data
Which is more secure: POST or GET?
POST is more secure
Which can send large amounts of data: POST or GET?
POST
Which method should you use to send confidential or sensitive data: POST or GET?
POST
What is a Query String?
A set of parameters passed from a browser to a web server
Often passed by placing name/value pairs at the end of a url
PHP code on the server can examine and utilise the values of parameters
A way for PHP code to produce different output based on values passed from the user