Cross-Origin Resource Sharing (CORS) je bezpečnostní mechanismus, který umožňuje webovým stránkám z jednoho zdroje přistupovat k datům ze serverů s jiným zdrojem. Bez CORS by takový přístup byl zakázán kvůli bezpečnostním důvodům. CORS tedy umožňuje…
When developing large systems (e.g., enterprise applications, shared software packages, libraries, ...) where multiple layers and developers communicate with each other, the problem of how to handle the release of new code versions arises.
Let's…
When consulting with knowledgeable and experienced project owners, I often come across the question of the long-term sustainability of a digital project. Many large projects that exceed 3 years of development start to become internally obsolete and…
Since you've been developing web applications for a while now, you've probably noticed that many things are routinely repetitive for you, even though they shouldn't be. Very often it's technical project management, file versioning, automated code…
In PHP, it is very easy to detect an IP address at a basic level:
echo 'You know, your IP address is' . $_SERVER['REMOTE_ADDR'] . '?';
Warning: Getting the IP address as the key of the $_SERVER['REMOTE_ADDR'] field is only possible if PHP was…
The eval function is used to execute the passed string as PHP code.
PHP language design and practical features
PHP is an interpreted language, which means in particular that its code is evaluated by an interpreter, a special type of program that…
If you are serious about developing web applications and the site will later be available on the Internet, it is very important to address security.
Realistically, the following threats await developers:
The application has an internal error, for…
The hashing process (as opposed to encryption) produces an output from the input from which the original string can no longer be derived.
It is therefore well suited for protecting sensitive strings, passwords and checksums.
Another nice feature of…
Warning: This article was written many years ago and some information may be outdated or incorrect. Please bear this in mind when reading.
The Caesar cipher is one of the simplest hashing functions. In its day it was virtually unbreakable, but in…
MD5 is a very commonly used function for calculating hashes.
Beginners often use it for password hashing, which is not a good idea because there are many ways to retrieve the original password.
This article describes specific methods for doing so.…
Often, we may want to attach a file to a page that we have stored on disk somewhere else. If we enter its exact name directly into the attach function, there is nothing to worry about.
Securely attaching a file
include 'menu.html';
The previous…
Support PHP4, PHP5
addcslashes - C-style slash string
Description
string addcslashes (string $str, string $charlist)
Returns a string with backslashes before the characters that are specified in the charlist parameter.
Parameters
str Text string…