summaryrefslogtreecommitdiffstats
path: root/PHP/HTTP-Class/index.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-06-04 21:54:48 +0200
committerThomas Lange <code@nerdmind.de>2021-06-04 21:54:48 +0200
commit8f212254454dc67fbbc7182732187e9a9801b1a9 (patch)
tree1e9ddd0a8eb5d822e708dc3e727995cc46706cea /PHP/HTTP-Class/index.php
parent32b8d78047e328dd9cd1e3b5b52a10cd972c2fa4 (diff)
downloadsnippets-8f212254454dc67fbbc7182732187e9a9801b1a9.tar.gz
snippets-8f212254454dc67fbbc7182732187e9a9801b1a9.tar.xz
snippets-8f212254454dc67fbbc7182732187e9a9801b1a9.zip
Revert "Add HTTP class"
This reverts commit 84e2b2be6f7537e0a4a9f0c323555404d2682a8a.
Diffstat (limited to 'PHP/HTTP-Class/index.php')
-rwxr-xr-xPHP/HTTP-Class/index.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/PHP/HTTP-Class/index.php b/PHP/HTTP-Class/index.php
deleted file mode 100755
index cc52561..0000000
--- a/PHP/HTTP-Class/index.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-#==============================================================================
-# Include HTTP class
-#==============================================================================
-require_once 'include/HTTP.php';
-
-#==============================================================================
-# Initialize HTTP class
-#==============================================================================
-HTTP::init();
-
-#==============================================================================
-# Check if GET parameters are set
-#==============================================================================
-if(HTTP::issetGET('parameter_one', 'parameter_two', 'parameter_three')) {
- $parameter_one = HTTP::GET('parameter_one');
- $parameter_two = HTTP::GET('parameter_two');
-
- var_dump($parameter_one, $parameter_two, HTTP::GET('parameter_three'));
-}
-
-#==============================================================================
-# Check if POST parameters are set
-#==============================================================================
-if(HTTP::issetPOST('parameter_one', 'parameter_two', 'parameter_three')) {
- $parameter_one = HTTP::POST('parameter_one');
- $parameter_two = HTTP::POST('parameter_two');
-
- var_dump($parameter_one, $parameter_two, HTTP::POST('parameter_three'));
-}
-
-#==============================================================================
-# Check if POST parameters in conjunction with a specific value are set
-#==============================================================================
-if(HTTP::issetPOST('parameter_one', 'parameter_two', ['parameter_three' => 'value_three'])) {
- // do something
-}
-
-#==============================================================================
-# Check the HTTP request method
-#==============================================================================
-if(HTTP::requestMethod('GET') OR HTTP::requestMethod('POST') OR HTTP::requestMethod('HEAD')) {
- // do something
-}
-
-#==============================================================================
-# Get the HTTP request method
-#==============================================================================
-$requestMethod = HTTP::requestMethod();
-
-#==============================================================================
-# Get the HTTP status code of the current request
-#==============================================================================
-$statusCode = HTTP::responseStatus();
-
-#==============================================================================
-# Send a HTTP status code to the client
-#==============================================================================
-HTTP::responseStatus(200);
-
-#==============================================================================
-# Send a custom HTTP response header to the client
-#==============================================================================
-HTTP::responseHeader(HTTP::HEADER_CONTENT_TYPE, HTTP::CONTENT_TYPE_TEXT);
-
-#==============================================================================
-# Send a HTTP redirect to the client and stop script execution
-#==============================================================================
-# HTTP::redirect('https://example.org/');
-# HTTP::redirect('https://example.org/', 303);
-?> \ No newline at end of file