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.
action=”Data.php” action=”Data.php” 4 Single Page Form Sumbition • Submitting a single page and retrieve data on same page is a professional way of submitting a form. Let see an example ”; echo ”Age is = ” . $a; } ?> Note: isset() determine if a variable is set and in not null. 5 ... - tailieumienphi.vn
nguon tai.lieu . vn