Skip to content
PHP nad MySQL Code snippets

PHP Tutorials and Code Snippets

Here are a few PHP code snippets and tutorials which I hope you will make use of.



Assigned IP Address access only This PHP script will only allow access to the webpage/website if the IP number is allowed by the script. You can enter an unlimited number of IP numbers. This is a great way to only allow access to a selected few.

Create a future date drop down list in PHP Ideal to use on a shopping cart where a date int he future can be set for delivery. Choose how many days in the future to set and the script will also remove weekends dates.

Get Server Root Path of Folders Get-Path will allow you to find the full root PHP path of a folder on your server or web hosting plan. This is ideal for finding out any full root paths which some PHP scripts require to run properly.

Spam and not the kind you eat from the tin! Spam volume is predicted to increase nearly 40 times over the next 5 years! As if the clutter in our inboxes wasn't overwhelming already now is the time to start thinking how to prevent it form happening to you.

Tips for Building a Great Website Designing a website may seem easy and in fact it may be for some people but for those who are taking the first steps need to know a few things to keep themselves on the right track at the start. By keeping to a few simple 'rules', you can design and maintain a website which you can be proud of putting your name to.

What is PHP and MySQL? PHP and MySQL are programs which are most usually pre-installed already onto your web hosting server. There are the most common programs which will make your website interactive and usable for your website visitors. The majority of the database applications and scripts that I write will utilise these.

Creating a website using PHP Includes I have had a few requests to write a simple tutorial on how to build a website using PHP includes. This is written for Jim as he wanted to know the easiest way to build a website, maintain it and still have individual pages for good search engines ranking positions.

Video Splash Screen Overlay Displaying a video from YouTube on your website is a great way to provide a bit of interaction. To make it a bit more presentable did you know that you can have your own splash screen overlay before the video starts with using a little bit of JavaScript and HTML.

Convert PHP Timestamp to Date Format PHP Timestamps are a great way to keep track of dates and times in PHP. The timestamp is the amount of time in seconds from January 1st 1970. See how you can change a timestamp to a readable date format to be used on your website or in your php code.

Redirect Link by Website URL in PHP This is a variation on the affilite link mask script i wrote, this PHP link redirect script will allow you to redirect any url without giving away the referral page in the receiving websites logs.

Encode a password with MD5 Securing a password which can then be readable again but not recovered can be a good way to set passwords for logins. MD5 Hash is way to do this. You can encode a password with MD5 and then use the PHP md5()

Display a Random Photo for each Month of the Year Add a bit of interaction to your website without doing anything. You can change a banner on your website each month automatically with the help of PHP and a little snippet of code.

Aligning DIV columns with CSS A simple way to align divs in rows is by using css to present the content to the browser. It is a very simple way to manage your data without the need for tables. To accomplish this we use a mixture of HTML and CSS.

Free Quote available for any custom PHP and Database Software, Contact Steve Dawson Today