tailieunhanh - PHP: The Good Parts: Delivering the Best of PHP- P3

PHP: The Good Parts: Delivering the Best of PHP- P3: Vượt qua tất cả các hype về PHP và thâm nhập vào sức mạnh thực sự của ngôn ngữ này. Cuốn sách này khám phá những tính năng hữu ích nhất của PHP và làm thế nào họ có thể đẩy nhanh quá trình phát triển web, và giải thích lý do tại sao thường được sử dụng PHP yếu tố thường được sử dụng sai hoặc misapplied. Bạn sẽ tìm hiểu thêm phần nào sức mạnh để lập trình hướng đối tượng, và làm thế nào để sử dụng. | GET method which still uses the URL as its vehicle . Any information that is sent along the query string in a key value pair is subsequently loaded into the _GET array in the called page. http login 1 logname Fred This URL example has two keys in the query string one called login and the other called logname. When the file is called you can manipulate these values if you so desire. All you have to do is reference the key within the associative array and then it s yours. Consider this code as part of the file. login _GET login logname _GET logname if login 1 echo Welcome . logname else echo login failed. please try again . logname The advantage to using the _GET superglobal is that you can access information that is established on one page and use it in a called file. It s important to understand that the _GET array is refreshed on each page call so you have to pass it on to each page being called further down the call stack. It s different than the session concept in this regard. _POST The _POST superglobal array is almost identical to the _GET array in that it can pass values effectively from one page to the next the difference lies in the method of passing the information. The _POST array does not use the query string in the URL of the called file as the transport method but instead uses the server s Hypertext Transfer Protocol HTTP POST method. This is seen most often in submitted forms on web pages but it can be used independently of the HTML form tag. Also since it uses the POST method on the server and information is not sent as part of the URL the information is less visible to the web user. So there is another modicum of security even if it s not foolproof. The following code will use the form tag in a small web page and then show you how to manage the _POST array in the called PHP file. html head head body form method post action please enter your name input type text size 15 name fullname .

TỪ KHÓA LIÊN QUAN