Why PHP strpos appears to give wrong answer?
The strpos function in PHP may appear to give the wrong answer when it is not used properly. strpos is designed to return the integer position of the first occurrence of a “substring” in...
read moreUsing addslashes to escape data going into the datatabase
You can not just take whatever user inputs and insert it into the database directly. Because what if the user data contains a single quote as in “The Jetson’s”. That string...
read moreMagic Quotes Deprecated in PHP
Magic quotes is enabled in the php.ini by … magic_quotes_gpc = On and is disabled by … magic_quotes_gpc = Off To see whether magic quotes is on or off on your server, you can use...
read morePHP: Use htmlspecialchars to output post variables
In the HTML5 slider control tutorial, we need a form to test the control. The simple way to output what was posted in the form is to do … The value submitted was <?php echo...
read moreResources on Web Security
Security on PHP.net Essential PHP Security book excerpt Sitepoint forums PHP Security Consortium Seven Habits for Writing Secure PHP...
read moreHow to Generate Random Number in PHP
To use PHP to generate a random number from say 1 to 9, you use the rand() function as in … <?php echo rand(1,9); ?> See example in action. Both parameters should be integers. And the...
read moreHow to See Your PHP Configuration Settings
Sometimes you need to see what PHP configuration settings are in effect on your server. For example, is safe_mode on or off, is magic quotes (magic_quotes_gpc) on or off, are there any disabled PHP...
read moreHow to Disable PHP from Running exec
PHP scripts has the ability to run Linux/Unix commands by using the PHP function exec(). That means that anyone with FTP access to your webserver can write a PHP script to execute Unix commands...
read moreHow to Compress Files on the Server Using PHP
Have you ever have to download a bunch of files from the server onto your local computer? Even with an FTP client, it takes a while when you got a lot of files (such as when backing up a whole set...
read moreAll contents are opinions and are copyrighted and may contain display ads and ad links for which site may receive revenues from.
See Terms of Use and Privacy Policy.