Tutorials on Web Development, Programming, and Web Design

Why PHP strpos appears to give wrong answer?

In Articles

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 more

Using addslashes to escape data going into the datatabase

In Articles

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 more

Magic Quotes Deprecated in PHP

In Articles

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 more

PHP: Use htmlspecialchars to output post variables

In Tutorials

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 more

Resources on Web Security

In Resources

Security on PHP.net Essential PHP Security book excerpt Sitepoint forums PHP Security Consortium Seven Habits for Writing Secure PHP...

read more

How to Generate Random Number in PHP

In Articles

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 more

How to See Your PHP Configuration Settings

In Featured Tutorials

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 more

How to Disable PHP from Running exec

In Featured Tutorials

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 more

How to Compress Files on the Server Using PHP

In Tutorials

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 more

Learn Web Tutorials is hosted by Hostmonster and design based on Wordpress template by Elegant Themes
All 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.