PHP Articles

PHP is one of the most popular server side languages.   Many popular open-source software such as WordPress, Joomla, Zencart, and many others are written in PHP.  PHP works well with MySQL database, which is one of the most popular open-source database.

Difference between htmlentities and htmlspecialchars in PHP

In Articles

What is the difference in htmlentities() and htmlspecialchars() function in PHP? htmlspecialchars() is a subset of htmlentities(). While htmlentities converts “all applicable characters to HTML...

read more

Things to Check to Make Sure PHP Code is Secure

In Articles

Here are some things to check to make sure PHP code is secure. Check to make sure you are validating or filtering inputs. Search $_GET, $_POST, $_REQUEST. Use filter_var(), strip_tags(),...

read more

PHP is insecure by default

In Articles

When I say PHP is insecure by default is that if you just write PHP code to do something (just like they teach in the basic tutorials or in first year programming classes), then most likely the code...

read more

Replace ShortCode using PHP

In Articles

Here we have a data.html file with two shortcodes marked by square brackets: [myimage.jpg] and [myimage2.jpg] … I want to write PHP code to search and replace with these… <a...

read more

How to implement log out in PHP?

In Articles

Implementing logout in PHP often will include a session_destroy().  But that is not all, you have to delete the session cookie and unset the session data.  See PHP manual linked here under...

read more

How should passwords be stored in the database?

In Articles

Suppose you are writing a PHP web application that needs to save username and passwords to MySQL database.  How should the passwords be saved? Do not store as plain text You probably know that you...

read more

How to determine if Pear is installed in PHP

In Articles

Suppose you are on a shared webhost with PHP.  You want to know if the commonly used Pear package is installed in this PHP installation. Just write the following PHP code  into a file named...

read more

PHP: How to find server path of current file

In Articles

Sometimes you need to find the absolute server path of the current file in order to determine the root location of your PHP application.  Provided that your current file is at the root of your...

read more

What is the Difference Between PHP echo versus print?

In Articles

There is not a whole lot of difference between the PHP echo versus print construct, but there are a few.   Note that both of them are PHP constructs.  They are not functions.  Hence, the...

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.

Learn Web Tutorials .com

searching how to sleep better