Tutorial using PHP to Query MySQL

In Tutorials

In this tutorial, we will use PHP to query a MySQL database.  For the purpose of this example, suppose we want to query the last 5 posts from a WordPress MySQL database.  We will need to know the...

read more

File Upload in PHP Tutorial

In Tutorials

In this tutorial, we will build a file upload form in PHP to upload an image file to the web server.   In the process, we will perform a few security checks to prevent file upload abuse. 1.  Start...

read more

Using Random Form Token to Help Protect Against CSRF

In Tutorials

Suppose we have the following form in index.php … that will POST to do.php to do something.  To help protect against CSRF (cross-site request forgery), in do.php we have to make sure that it...

read more

How to Create a Right-Click Menu using JQuery

In Tutorials

In this tutorial, we will create a right-click menu (better known as a context menu) that will come up when you right-click on the page … For Mac, you would do Ctrl-Click, since Mac mouse have...

read more

AngularJS Posting Login Form

In Tutorials

In this example, we are going to create a Bootstrap login form and have AngularJS perform an POST on this form to a backend PHP page to see if the username and password is correct. 1. We first...

read more

Using Javascript logical OR operator as an default operator

In Tutorials

The Javascript logical OR operator works like this … If the first operand is truthy (see what is truthy and falsy), it will return the first operand.  Otherwise it will return the second...

read more

Javascript logical AND operator does not necessarily return boolean true false

In Tutorials

If you came from other programming language, you might expect the Javascript boolean operator to return a boolean true or false.  But this is not necessarily the case in Javascript.  It will return...

read more

How to delete array elements in Javascript

In Tutorials

To delete array elements in Javascript, you can either use delete or splice.  The difference is that use of delete leaves “holes” in the array … This removes the “c”...

read more

Javascript not sorting numeric arrays correctly

In Tutorials

Javascript arrays have a sort method, but it does not sort numeric arrays as expected.  For example, this code … sorts them as if they are string, rather than numeric as expected....

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.