When you manually include the PHP class, you can do this while the current script is running, right? Then you can decide if the condition matches you, download it, and if not, you wonโt. Like this:
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) { include '../../../Whatever/SanitizeUserInput.class.php'; SanitizeUserInput::sanitize($_POST['someFieldName']); }
But let's say I use autoload with this class. Will it be loaded effectively at the beginning, or will it be loaded only if used?
I want to say whether I should add the __autoload function only in classes on which I am 100% sure that I will use in any script (for example, connecting to a database, managing session, etc.)?
thanks
source share