Difference between htmlentities and htmlspecialchars in PHP
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 morePHP Proper Logout Code
To provide a logout function, we have to destroy the session and expire the cookie (if cookies are being used to pass along the session identifier). Based on the PHP manual, you have something like...
read moreThings to Check to Make Sure PHP Code is Secure
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 morePHP is insecure by default
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 moreExample of Using PhpMailer to send emails in PHP
PHP has a default mail() function for sending out emails. However, the open source PHPMailer Library is much more easier to use. You don’t have to construct the mail headers yourself, and...
read moreTrying to setup PHP development environment with Vagrant
We want to set up a PHP development environment. In the past, we would install the LAMP stack (Linux Apache MySQL and PHP) directly on our machine or use a package like XAMPP, MAMP, or WAMP. But...
read moreUsing Prepared Statement with PHP and MySQL
In the previous tutorial, we used mysqli API that comes with PHP to query a MySQL database. In this tutorial, instead of sending a SQL query statement, we are going to use prepared statement to...
read moreUpdating MySQL with PHP using mysqli
This tutorial continues directly from the last tutorial where we inserted an record. Now we will update the record that was just inserted. Adding to the previous code, we construct an MySQL...
read moreUsing mysqli to insert to MySQL database
In previous tutorial, we will saw how to query from MySQL database, now we use mysqli to insert to the “example” table of the a MySQL database. Like before, we call mysqli_connect with...
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.