How to use Custom Error Pages using .htaccess

Sometimes, users try to access pages that: No longer exist. They don’t have permission to view. Have never existed. …and so on! It’s your job to not only add the actual content to your website, but to handle the various errors that your visitors may encounter. The most common error pages that your users will [...]

Read more

How to Redirect from Non-WWW to WWW using .htacccess

Although it’s just my opinion, I believe that all non-www domains should be redirected to include the www. Why? What benefits does this have? It provides consistency and makes the domain look nicer. Search engines can index both versions of your domain, www and non-www since they can contain different content – which of course [...]

Read more

PHP: Get the File Name of the Current URL

Today I required to do some redirection based on the current file name within an include file. So how do you get the file name of the current URL? It’s actually really simple, so I’ll go straight onto the example. The Example Take the URL http://www.dailywebtuts.com/index.php for example. The file name would be index.php In [...]

Read more

Learn PHP: Using IF and ELSE and the strpos Function

Checking to see if a substring exists within a string using strpos You can use strpos in order to check if one string (the substring) exists in another string. An example of this can be seen below: In the example above, the output would be 3, as this is the starting position of the substr [...]

Read more

Using jQuery to Fade In and Fade Out Content

The more and more I use the internet, the more and more I see the use of jQuery to fade in content. So, it goes without saying that I decided to create a short and sweet tutorial to teach you how to use jQuery yourself to fade in content. Since this is my first tutorial [...]

Read more

Learning PHP: Common PHP String Functions

You’re now up to the stage where you’ve learnt how to assign values and strings to variables. In this post you’ll be learning to use various PHP functions teaching you how to manipulate and/or use PHP to a greater level. A quick note about PHP strings There is no maximum length to a PHP string [...]

Read more

Fatal error: Class ‘PDO’ not found!

I’m currently in the process of re-writing some of my PHP scripts in order to move away from “old” ways to connect to databases, to a newer method – PDO (PHP Data Objects). Using the following code, I received the message “Fatal error: Class ‘PDO’ not found…” The following are likely reasons for you receiving [...]

Read more

Learning PHP: PHP with HTML

Now that you’ve learnt how to create variables in PHP and then output them, you’re probably wondering how you can use PHP alongside HTML? Just how does it work? It’s really simple, and I’m going to show you how to take a very basic HTML script like the one below which displays the heading “Hello [...]

Read more

Learning PHP Part 2 – Setting and Displaying Variables

If you stumbled upon this page and have no knowledge of PHP then you’re better off starting here. Otherwise, continue! PHP Variables What is a variable? Variables are placeholders for storing content. You can contain anything from numbers to a text strings. All PHP variables start with a $, and there are some basic rules [...]

Read more

Learning PHP: Getting Started

My main reason for creating dailywebtuts.com is to teach others how to develop their own websites and web-based applications, and since I develop using PHP on a daily basis, I’ve decided to write a series of posts in order to teach PHP from scratch. Recommended Prerequisites to Learning PHP Before you learn PHP it’s recommended [...]

Read more

Creating a Page of Posts in WordPress

When running a WordPress blog you may find it necessary to create a page showing posts from a specific author, category, date range, or other criteria. Firstly, you need to create a template file for the page of posts. To do so, the easiest way to do this is to take a copy of the following [...]

Read more

Choosing a Web Browser for Development

When it comes to browsing the internet, or using a certain web browser for web development, does it really matter? Yes, it does! When developing websites, why would you want to be thwarted by a slow and unresponsive browser which doesn’t easily allow you to develop? The answer is that you wouldn’t want to be. [...]

Read more

How to Choose a Good Web Host

If you’re reading this, then you probably fall into one of two categories; you’re new to web development and are looking for a company to host your website, or you’re already into web development and you’re looking to switch from your current web host to a web host who’ll provide you with a better hosting [...]

Read more