All Posts on Web Development and Programming

Disable PHP Functions Using disable_functions in php.ini

PHP is a feature rich scripting language, but when used improperly, whether intentionally or unintentionally, it can cause damage to be done. This damage can be total compromise of the web server and/or its data. Using the php.ini file, we can easily disable PHP functions which we deem to be dangerous.

Website Critical Mass - An analysis of social networks and content driven websites

The definition of critical mass may vary widely but the concept remains the same. It is a quantity of something that above which will cause a chain reaction.

How does this tie in with websites? What drives websites first and foremost are its visitors. When we think of the critical mass of a website we are thinking about how many active visitors the website needs to have a chain reaction. Chain reaction in this sense will describe drawing the attention of more visitors to the site.

Redirecting index page to Directory Root using Apache

Sometimes, due to inconsistent linking, a link my be made to your homepage as or it may be linked as

Usually, both these pages are the same thing as index.php is usually configured in Apache as the page to be displayed when a directory is requested. In this tutorial, we will look at redirecting the index page to the directory root in Apache to prevent duplicate content issues.

PHP isset vs empty

In this tutorial, we will examine the difference between the isset function and the empty function in PHP. We will be looking at the 2 functions head to head by putting PHP isset vs empty.

Both functions share similar characteristics but the subtle differences between both should be noted. For the vast majority of the time, these functions should not be used interchangeably.

Simply enough, the isset function checks to see if a variable is actually set and that its value is NOT NULL

Why can't I edit a node that I have permission to edit in Drupal?

In Drupal, sometimes when you add the appropriate permissions for a user to be able to edit a node you are surprised when no edit tab comes up and if you navigate to the edit URL directly you get an "access denied" error.

If you think you have added the permissions correctly and cleared all the relevant caches, the following may help you solve your problem. It turns out that you may not have added the permissions correctly after all.

Hide Apache and PHP Version and Signatures in Ubuntu Linux

By default, your Apache web server (and PHP if it is installed) will indicate to clients the exact version of the Apache software which is running. This version information can be seen in the HTTP response header.

New Website SEO - The chicken or the egg

New website owners are put in a tight corner when it comes to promoting their new website. Modern search engines usually place higher rankings on those sites that have more sites linking to them, that is, those with more inbound links.

How then, is it that a new website will get anyone linking to it, when no one knows that it even exists since it is at the bottom of a search engine result page? The is the heart of the chicken and egg dilemma that new webmasters are faced with.

Drupal 6 - Adding an Above Comments Block to a node

In this Drupal tutorial, we will look at how to add a block which comes right before the comments for a node. At times it is necessary to add some content on a node but it should come before (above) the comments for that node. For example, you could want to display an advertisement or links for sharing or any other content like that.

Adding an above contents block can be done in 3 steps as the tutorial below shows.

Remove Homepage Textbox from Comment Form in Drupal 6

In this tutorial, we will look at how to remove the homepage textbox from the default Drupal 6 comment form.

You may want to remove this textbox to clean up the default comment area that Drupal renders out of the box, or you may simply not want users to be able to leave links to their homepage.

Whatever your reason, we will see how to rectify the issue in the tutorial below.

Drupal 6 - Remove / Hide Formatting Options Link in Comment Form

In this tutorial, we show you how to remove the "More information about formatting options" text that Drupal places below the comment text area by default.

This is usually done to clean up the comments text area as the formatting options can look quite ugly and out of place.

Just add the following code to the "template.php" file that exists in the directory of the theme that you are using. If the file does not exist just create it.

The code to be added is shown below:

function phptemplate_filter_tips_more_info()
    return '';

Drupal 6 - How to Remove 'Not Verified' from Anonymous Comments

In this Drupal tutorial, we will look at how to remove the 'Not Verified' which goes next to an anonymous user's name when they post a comment.

To remove 'Not Verified' from anonymous comments in Drupal 6, all you have to do is override an existing function. We do this by editing the "template.php" file (create it if it does not exist) in our theme folder and placing some code inside it. The tutorial below will show you how.

Enable Compression on Apache with mod_deflate

Enabling compression on Apache is a trade-off between CPU load and bandwidth. It is usually faster to compress content as more time is saved when transferring a smaller file as opposed to the minimum CPU time which is required to compress the data in the first place.

We first need to enable mod_deflate. This is the module which handles the compression of the data.

On modern Linux versions with Apache 2:

a2enmod deflate

On Windows edit the "httpd.conf" file and uncomment the following line like so: