Categories
Security Useful

HTTP Security Headers Which Should be Used by all Webmasters

The most important HTTP Security Headers which should be used by all webmasters: Content-Security-Policy is an effective measure to protect your site from XSS attacks. By whitelisting sources of approved content, you can prevent the browser from loading malicious assets. Directives include upgrade-insecure-requests; , default-src, script-src, style-src, img-src, object-src, plugin-types to specify permitted sources for scripts, CSS stylesheets, and images. A basic […]

Categories
PHP Useful

Get HTTP Status Code – PHP Functions

Below are some useful solutions (php functions) for HTTP Status Codes returned in the required page header by servers when loading a web page. global $http_status_code; $http_status_code = [ // ~~~ officially known https codes 100 => ‘Continue’, 101 => ‘Switching Protocols’, 102 => ‘Processing’, // WebDAV; RFC 2518 103 => ‘Early Hints’, // RFC 8297 […]

Categories
Servers

Common HTTP response status codes

200 OK The request has succeeded and depends on the HTTP method (The most common response code): GET: the resource has been fetched & is transmitted in the message body. HEAD: the entity headers are in the message body. POST/PUT: result of the action is transmitted in the message body. 201 Created Is typically the […]

Categories
PHP Useful

Get HTTP Status Code from Header – PHP

1. First of all we have to: deactivate the SSL verification because there are cases in which the site is redirected from a domain where the SSL has expired! limit the number of redirects, so as not to enter an endless loop initialize User-Agent with a real value , otherwise there is the possibility that […]

Categories
PHP Useful

Add and Remove Query String Variables in PHP – The Easy Way

PHP offers two functions that are very useful for us in generating or modifying a link: parse_str – automatically converts all query parameters into an array http_build_query – generates a URL-encoded query string from the associative (or indexed) array Below is a function that can help you add, delete or modify a parameter in a […]