Xem mẫu
Web Engineering
Lecture 23-to-28
MAJID MUMTAZ Department of Computer Science, CIIT Wah
1
PHP forms & user input
• The php $_GET & $_POST variable are used to retrieve information from forms, like user input.
• PHP $_GET: The $_GET variable is used to collect values from a form with method=”GET”.
• The $_GET variable is used to collect values from a form with a method=”GET”. Information sent from a form with the GET method is visible to everyone (It will be displayed in the browser’s address bar) and it has limits on the amount of information to send (max. 2000 characters acc. To W3school website)
2
PHP $_POST Method
• The $_POST variable is used to collect values from a form with method=”POST”
• The $_POST variable is used to collect values from a form with method=”POST”. Information sent from a form with the POST method is invisible to others and has no limit on the amount of information to send.
3
$_REQUEST with PHP
• $_REQUEST variable: variable can be used to get the result from data sent with both the GET and POST methods. i.e.
nguon tai.lieu . vn