Tutorials on Web Development, Programming, and Web Design

Tutorial on Getting Started with Mustache Template in PHP

In Tutorials

In this getting-started tutorial, we will show you how to use the mustache templating system in PHP.  The main mustache template is http://mustache.github.io/  And it documentation is linked...

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

How to determine if a string ends with a particular string in PHP?

In Tutorials

Unfortunately, there is no built-in PHP function that tests if a “haystack” string ends with a “needle” string. As an concrete example, suppose you want to determine if the...

read more

PHP to connect and query from WordPress mysql database

In Tutorials

In this tutorial, we will learn how to write PHP to connect to a mysql database and then perform a query.  For a newer tutorial, see here also. For the purpose of demonstration, the mysql database...

read more

How to Handle Magic Quotes in PHP

In Tutorials

Continuing from our previous tutorial, our example assumed that your PHP server has magic quotes turned off (which is preferred).  Because PHP manual says … “It’s preferred to code...

read more

How to Use Session Variables in PHP

In Tutorials

We continue from the previous tutorial.   Here is demo. 4. Now suppose we add a link on the confirmation page to go back to the previous index.php page … 5.   When we click on that link,...

read more

The correct way to post and echo form values

In Tutorials

In this tutorial, we will post a form value and echo it back.  But taking care to escape the values using htmlspecialchars() in order to prevent cross-site scripting attacks. A demo here shows the...

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

Using short versus long form of PHP open close tags

In Articles

PHP code in HTML document is sectioned off by PHP opening and closing tags as shown here… There is the question whether to use the long form as shown above versus using the short form as shown...

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.