là một thành phần đóng gói yêu cầu HTTP thực tế (thường được tạo bởi trình duyệt) và được gửi đến ứng dụng của chúng tôi. Đối tượng là một đối tượng giá trị đơn giản được truyền giữa các lớp điều phối và điều khiển, bao bọc môi trường yêu cầu HTTP. Nó cũng cung cấp quyền truy cập dễ dàng vào thông tin như dữ liệu tiêu đề, tệp, phương thức, biến, v.v. isPost()) {
// AJAX
if (true === $request->isAjax()) {
// ....
}
}
Nhận giá trịPHP tự động điền vào các mảng siêu toàn cầu $_GET, $_POST và $_REQUEST tùy thuộc vào loại yêu cầu. Các mảng này chứa các giá trị có trong các biểu mẫu được gửi hoặc các tham số được gửi qua URL. Các biến trong mảng không bao giờ được làm sạch và có thể chứa các ký tự không hợp lệ hoặc thậm chí là mã độc hại, điều này có thể dẫn đến các cuộc tấn công SQL injection hoặc Cross Site Scripting (XSS) cho phép bạn truy cập các giá trị được lưu trữ trong các mảng $_GET, $_POST và $_REQUEST và khử trùng hoặc lọc chúng bằng dịch vụ bộ lọc Có 5 phương pháp cho phép bạn truy xuất dữ liệu đã gửi từ một yêu cầu get('userEmail', 'email', '[email protected]');
2get('userEmail', 'email', '[email protected]');
3get('userEmail', 'email', '[email protected]');
4get('userEmail', 'email', '[email protected]');
5get('userEmail', 'email', '[email protected]');
6
Tất cả (ngoại trừ get('userEmail', 'email', '[email protected]');
6) chấp nhận các thông số sauget('userEmail', 'email', '[email protected]');
8 tên của giá trị cần lấyget('userEmail', 'email', '[email protected]');
9 (mảng/chuỗi) chất khử trùng để áp dụng cho giá trịget('userEmail', null, '[email protected]');
0 được trả về nếu phần tử không được xác định (_______9_______1)get('userEmail', null, '[email protected]');
2 nếu được đặt (mặc định) và giá trị trống, thì get('userEmail', null, '[email protected]');
0 sẽ được trả về; get('userEmail', null, '[email protected]');
5 áp dụng đệ quy các chất khử trùng trong giá trị (nếu giá trị là một mảng)
get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
get('userEmail', 'email', '[email protected]');
6 chỉ chấp nhận biến get('userEmail', 'email', '[email protected]');
8 (chuỗi), đại diện cho tên của biến máy chủ mà bạn cần truy xuất$_REQUESTSiêu toàn cục $_REQUEST chứa một mảng kết hợp chứa nội dung của $_GET, $_POST và $_COOKIE. Bạn có thể lấy dữ liệu được lưu trữ trong mảng bằng cách gọi phương thức get('userEmail', 'email', '[email protected]');
2 trong đối tượng như sauVí dụ Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
0get('userEmail');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
0. Vệ sinh giá trị bằng chất khử trùng getQuery('userEmail');
3get('userEmail', 'email', '[email protected]');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
0. Đừng vệ sinh nó. Nếu tham số là null, trả về giá trị mặc địnhget('userEmail', null, '[email protected]');
$_GET$_GET superglobal chứa một mảng kết hợp chứa các biến được truyền tới tập lệnh hiện tại thông qua các tham số URL (còn được gọi là chuỗi truy vấn). Bạn có thể lấy dữ liệu được lưu trữ trong mảng bằng cách gọi phương thức get('userEmail', 'email', '[email protected]');
3 như sauVí dụ Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
8getQuery('userEmail');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
8. Vệ sinh giá trị bằng chất khử trùng getQuery('userEmail');
3getQuery('userEmail', 'email', '[email protected]');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail');
8. Đừng vệ sinh nó. Nếu tham số là null, trả về giá trị mặc địnhgetQuery('userEmail', null, '[email protected]');
$_POST$_POST superglobal chứa một mảng kết hợp chứa các biến được chuyển đến tập lệnh hiện tại thông qua phương thức HTTP POST khi sử dụng getQuery('userEmail', 'email', '[email protected]');
4 hoặc getQuery('userEmail', 'email', '[email protected]');
5 làm HTTP getQuery('userEmail', 'email', '[email protected]');
6 trong yêu cầu. Bạn có thể lấy dữ liệu được lưu trữ trong mảng bằng cách gọi phương thức get('userEmail', 'email', '[email protected]');
4 như sauVí dụ Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail', 'email', '[email protected]');
9getPost('userEmail');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail', 'email', '[email protected]');
9. Vệ sinh giá trị bằng chất khử trùng getQuery('userEmail');
3getPost('userEmail', 'email', '[email protected]');
Lấy trường get('userEmail', null, '[email protected]');
9 từ siêu toàn cầu getQuery('userEmail', 'email', '[email protected]');
9. Đừng vệ sinh nó. Nếu tham số là null, trả về giá trị mặc địnhget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
0ĐặtĐối tượng yêu cầu phân tích luồng PUT đã được nhận nội bộ. Bạn có thể lấy dữ liệu được lưu trữ trong mảng bằng cách gọi phương thức get('userEmail', 'email', '[email protected]');
5 như sauVí dụ Lấy trường get('userEmail', null, '[email protected]');
9 từ luồng getQuery('userEmail', null, '[email protected]');
7get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
1Lấy trường get('userEmail', null, '[email protected]');
9 từ luồng getQuery('userEmail', null, '[email protected]');
7. Vệ sinh giá trị bằng chất khử trùng getQuery('userEmail');
3get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
2Lấy trường get('userEmail', null, '[email protected]');
9 từ luồng getQuery('userEmail', null, '[email protected]');
7. Đừng vệ sinh nó. Nếu tham số là null, trả về giá trị mặc địnhget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
3$_SERVER$_SERVER superglobal chứa một mảng chứa thông tin như tiêu đề, đường dẫn và vị trí tập lệnh. Bạn có thể lấy dữ liệu được lưu trong mảng bằng cách gọi phương thức get('userEmail', 'email', '[email protected]');
6 như sauVí dụ Lấy giá trị getPost('userEmail');
4 từ siêu toàn cầu getPost('userEmail');
5get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
4Chất khử trùng cài sẵnViệc một số trường nhất định sử dụng cùng một tên trong ứng dụng của bạn là điều tương đối phổ biến. Một trường được đăng từ một biểu mẫu trong ứng dụng của bạn có thể có cùng tên và chức năng với một biểu mẫu khác ở một khu vực khác. Ví dụ về hành vi này có thể là các trường getPost('userEmail');
6, get('userEmail', 'email', '[email protected]');
8, v.v.Để làm cho quá trình làm sạch dễ dàng hơn, khi truy xuất các trường như vậy, hãy cung cấp một phương pháp để xác định các bộ lọc làm sạch đó dựa trên các phương thức HTTP khi thiết lập đối tượng get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
5Ở trên sẽ tự động làm sạch bất kỳ tham số nào được ĐĂNG từ một biểu mẫu có tên getPost('userEmail');
6 hoặc get('userEmail', 'email', '[email protected]');
8 với các bộ lọc tương ứng của chúng. Quá trình khử trùng diễn ra khi gọi các phương thức sau (một phương thức cho mỗi phương thức HTTP)Các phương thức này chấp nhận các tham số giống như get('userEmail', 'email', '[email protected]');
4, get('userEmail', 'email', '[email protected]');
5 và get('userEmail', 'email', '[email protected]');
3 nhưng không có tham số getPost('userEmail', 'email', '[email protected]');
6Bộ điều khiểnNếu bạn sử dụng vùng chứa, vùng chứa đã được đăng ký cho bạn. Nơi phổ biến nhất để truy cập môi trường yêu cầu là trong hành động của bộ điều khiển. Để truy cập đối tượng từ bộ điều khiển, bạn sẽ cần sử dụng thuộc tính công khai getPost('userEmail', 'email', '[email protected]');
7 của bộ điều khiểnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
6Kiểm tra hoạt độngThành phần chứa một số phương thức giúp bạn kiểm tra hoạt động hiện tại. Chẳng hạn, nếu bạn muốn kiểm tra xem một yêu cầu cụ thể có được thực hiện bằng AJAX hay không, bạn có thể làm như vậy bằng cách sử dụng phương thức getPost('userEmail', 'email', '[email protected]');
8. Tất cả các phương thức đều có tiền tố là getPost('userEmail', 'email', '[email protected]');
9getPost('userEmail', 'email', '[email protected]');
8. Kiểm tra xem yêu cầu đã được thực hiện bằng AJAX chưaget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
01. Kiểm tra xem phương thức HTTP có CONNECT hay khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
02. Kiểm tra xem phương thức HTTP có bị XÓA khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
03. Kiểm tra xem phương thức HTTP có phải là GET khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
04. Kiểm tra xem phương thức HTTP có phải là HEAD khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
05. Kiểm tra xem phương thức HTTP có khớp với bất kỳ phương thức nào đã thông qua khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
06. Kiểm tra xem phương thức HTTP có phải là TÙY CHỌN khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
07. Kiểm tra xem phương thức HTTP có phải là PATCH hay khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
08. Kiểm tra xem phương thức HTTP có phải là POST hay khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
09. Kiểm tra xem phương thức HTTP có phải là PURGE hay không (hỗ trợ Squid và Varnish)get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
10. Kiểm tra xem phương thức HTTP có phải là PUT khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
11. Kiểm tra xem yêu cầu đã được thực hiện bằng bất kỳ lớp bảo mật nào chưaget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
12. Kiểm tra xem yêu cầu đã được thực hiện bằng SOAP chưaget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
13. Kiểm tra xem phương thức HTTP có phải là TRACE khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
14. Kiểm tra xem một phương thức có phải là một phương thức HTTP hợp lệ không
kiểm tra sự tồn tạiCó một số phương thức có sẵn cho phép bạn kiểm tra sự tồn tại của các phần tử trong yêu cầu. Các phương thức này có tiền tố là get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
15. Tùy thuộc vào phương pháp được sử dụng, bạn có thể kiểm tra xem một phần tử có tồn tại trong bộ đệm getQuery('userEmail');
0, getQuery('userEmail');
8, getQuery('userEmail', 'email', '[email protected]');
9, getPost('userEmail');
5, get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
20, PUT và tiêu đề yêu cầu hay khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
21. Kiểm tra xem siêu toàn cầu $_REQUEST có một phần tử nào đó khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
22. Kiểm tra xem yêu cầu có bất kỳ tệp đã tải lên nào khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
23. Kiểm tra xem các tiêu đề có một yếu tố nhất địnhget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
24. Kiểm tra xem $_POST superglobal có một phần tử nào đó khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
25. Kiểm tra xem dữ liệu PUT có một phần tử nào đó khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
26. Kiểm tra xem $_GET superglobal có một phần tử nào đó khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
27. Kiểm tra xem $_SERVER superglobal có một phần tử nào đó khôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
28. Trả về số lượng tệp có trong yêu cầu
Yêu cầu thông tinĐối tượng cung cấp các phương thức cung cấp thông tin bổ sung liên quan đến yêu cầu get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
29. Nhận thông tin xác thực được trình duyệt/ứng dụng khách chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
30. Nhận thông tin xác thực được trình duyệt/ứng dụng khách chấp nhận
Khách hàngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
31. Nhận địa chỉ IPv4 của khách hàng nhiều nhất có thểget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
32. Nhận một mảng bộ ký tự và chất lượng của chúng được trình duyệt/máy khách chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
33. Nhận tác nhân người dùng HTTP được sử dụng để thực hiện yêu cầuget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
34. Nhận trang web đề cập đến yêu cầu đang hoạt động
Nội dungget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
35. Nhận một mảng với mime/types và chất lượng của chúng được trình duyệt/client chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
36. Nhận kịch câm/loại tốt nhất được trình duyệt/máy khách chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
37. Nhận loại nội dung mà yêu cầu đã được thực hiệnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
38. Nhận phần thân yêu cầu thô JSON HTTP đã giải mãget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
39. Nhận nội dung yêu cầu thô HTTP
i18nget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
40. Nhận bộ ký tự tốt nhất được trình duyệt/máy khách chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
41. Nhận ngôn ngữ tốt nhất được trình duyệt/máy khách chấp nhậnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
42. Nhận mảng ngôn ngữ và chất lượng của chúng được trình duyệt/máy khách chấp nhận
Người phục vụget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
43. Nhận thông tin về cổng mà yêu cầu được thực hiệnget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
44. Nhận IP địa chỉ máy chủ đang hoạt độngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
45. Lấy tên máy chủ đang hoạt độngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
46. Nhận lược đồ HTTP (http/https)get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
47. Nhận HTTP URI mà yêu cầu đã được thực hiện. Nếu get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
48 được truyền dưới dạng tham số, phần truy vấn sẽ không được trả về
get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
7Một số phương pháp get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
8Lấy địa chỉ IP của máy chủ. I E. get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
49get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
9Lấy địa chỉ IP của khách hàng tức là. get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
50get('userEmail');
0Nhận tác nhân người dùng ( get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
51)get('userEmail');
1Nhận nội dung được chấp nhận tốt nhất bởi trình duyệt. tức là văn bản/xml get('userEmail');
2Nhận bộ ký tự tốt nhất được trình duyệt chấp nhận. I E. get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
52get('userEmail');
3Nhận ngôn ngữ tốt nhất được chấp nhận cấu hình trong trình duyệt. I E. get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
53Phương phápget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
54 trả về phương thức HTTP mà yêu cầu đã được thực hiện. Nếu tiêu đề get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
55 được đặt và nếu phương thức là get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
56, thì nó được sử dụng để xác định phương thức HTTP dự định "thực". Tham số yêu cầu get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
57 cũng có thể được sử dụng để xác định phương thức HTTP, get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
58 đã được gọi. Phương thức luôn trả về một chuỗi chữ hoaget('userEmail');
4Tiêm phụ thuộcĐối tượng thực hiện giao diện. Do đó, vùng chứa DI có sẵn và có thể được truy xuất bằng phương pháp get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
59. Một thùng chứa cũng có thể được đặt bằng phương thức get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
60Tiêu đề yêu cầu chứa thông tin hữu ích, cho phép bạn thực hiện các bước cần thiết để gửi lại phản hồi thích hợp cho người dùng. Hiển thị các phương thức get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
61 và get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
62get('userEmail');
5Phương thức get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
63 sẽ trả về tên máy chủ được yêu cầu sử dụng. Phương pháp sẽ cố gắng tìm tên máy chủ theo thứ tự sauget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
64get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
65get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
66
Tùy chọn get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
63 xác thực và thực hiện kiểm tra nghiêm ngặt tên máy chủ. Để đạt được điều đó, bạn có thể sử dụng phương pháp get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
68Tệp đã tải lênMột tác vụ phổ biến khác là tải tệp lên. cung cấp một cách hướng đối tượng làm việc với các tập tin. Để toàn bộ quá trình tải lên hoạt động, bạn cần thực hiện các thay đổi cần thiết đối với get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
69 của mình (xem phần )get('userEmail');
6Mỗi đối tượng được trả về bởi get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
70 là một thể hiện của đối tượng thực hiện lớp. Sử dụng mảng siêu toàn cầu get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
20 cung cấp hành vi tương tự. chỉ gói gọn thông tin liên quan đến từng tệp được tải lên cùng với yêu cầuget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
72 chấp nhận hai tham sốget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
73. Chỉ chứa các bản tải lên thành côngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
74. Trả về mảng có các khóa được đặt tên thu được trong quá trình tải lên
Phương thức trả về một mảng các đối tượng. Mỗi đối tượng cung cấp các thuộc tính và phương thức sau, cho phép bạn làm việc với các tệp đã tải lên get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
75 (chuỗi) - Trả về bất kỳ lỗi nào xảy ra với tệp nàyget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
76 (chuỗi) - Trả về phần mở rộng của tệpget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
77 (chuỗi) - Trả về khóa nội bộ của tệpget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
78 (chuỗi) -Trả về tên thật của tệp đã tải lênget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
79 (chuỗi) - Trả về loại kịch câm thực của tệp tải lên bằng finfoget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
80 (int) - Trả về kích thước tệp của tệp đã tải lênget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
81 (chuỗi) - Trả về tên tạm thời của tệp đã tải lênget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
82 (chuỗi) - Trả về loại mime do trình duyệt báo cáo. Loại kịch câm này không hoàn toàn an toàn, thay vào đó hãy sử dụng get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
79get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
84 (bool) - Kiểm tra xem tệp đã được tải lên qua get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
56get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
86 (bool) - Di chuyển tệp tạm thời đến đích trong ứng dụng
Tiêm phụ thuộcĐối tượng thực hiện giao diện. Do đó, vùng chứa DI có sẵn và có thể được truy xuất bằng phương pháp get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
59. Một thùng chứa cũng có thể được đặt bằng phương thức get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
60Sự kiệnĐối tượng thực hiện các giao diện. Kết quả là bạn có thể sử dụng get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
89 và get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
90Sự kiện Mô tả Có thể dừng hoạt độngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
91Cháy khi ủy quyền đã được giải quyếtKhôngget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
92Cháy trước khi ủy quyền đã được giải quyếtCóKhi sử dụng ủy quyền HTTP, tiêu đề get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
93 có định dạng sauget('userEmail');
7trong đó get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
94 là một loại xác thực. Một loại phổ biến là get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
95. Các loại xác thực bổ sung được mô tả trong sổ đăng ký IANA về lược đồ xác thực và Xác thực cho máy chủ AWS (AWS4-HMAC-SHA256). Trong hầu hết các trường hợp sử dụng, loại xác thực làget(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
96get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
95get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
98get(
$name = null, // string
$filters = null, // mixed
$defaultValue = null, // mixed
$notAllowEmpty = false, // bool
$noRecursive = false // bool
): mixed
99get('userEmail');
00get('userEmail');
01get('userEmail');
02get('userEmail');
03get('userEmail');
04get('userEmail');
05get('userEmail');
06
Bạn có thể sử dụng các sự kiện get('userEmail');
07 và get('userEmail');
08 để thực hiện các thao tác bổ sung trước hoặc sau khi giải quyết ủy quyềnget('userEmail');
07 nhận mảng get('userEmail');
10 với khóa get('userEmail');
11 là tham số thứ hai của sự kiệnget('userEmail');
08 nhận mảng get('userEmail');
10 với khóa get('userEmail');
11 cũng như các tiêu đề với khóa get('userEmail');
15
Làm cách nào để NHẬN yêu cầu HTTP trong PHP?
5 cách tạo yêu cầu HTTP trong PHP . Trình bao bọc luồng HTTP/s của PHP Phần mở rộng cURL của PHP GuzzleHttp Httpful Máy khách HTTP của Symfony
Làm cách nào để kiểm tra HTTP hoặc HTTPS trong PHP?
Cách tiếp cận 1. Kiểm tra xem kết nối có đang sử dụng SSL hay không và nếu giá trị của $_SERVER['HTTPS'] được đặt, thì chúng tôi có thể nói rằng kết nối được bảo mật và được gọi từ 'HTTPS'. If the value is empty, this means the value is set to '0' or 'off' then we can say that the connection is not secured and the page is called from 'HTTP'.
Làm cách nào để NHẬN tiêu đề yêu cầu HTTP trong PHP?
Nhận được tiêu đề yêu cầu, máy chủ web sẽ gửi lại tiêu đề phản hồi HTTP cho máy khách. Đọc bất kỳ tiêu đề yêu cầu. Có thể đạt được điều này bằng cách sử dụng hàm getallheaders() . ví dụ 2. Nó có thể đạt được bằng cách sử dụng hàm apache_request_headers().
Tại sao chúng tôi sử dụng $request trong PHP?
PHP $_REQUEST là biến siêu toàn cầu PHP được sử dụng để thu thập dữ liệu sau khi gửi biểu mẫu HTML . |