Archive for the 'PHP' Category

Learning Perl for Beginners: Getting Started

Well if you have decided to take the plunge into Perl I commend you. So far my experience with Perl has been really great. I have already made very useful programs for both Windows and Linux. Coming from a web development background I like to think of Perl as the “PHP for operating systems”. If PHP is great for creating dynamic websites, Perl is great for manipulating anything to do with your operating system and applications. The best part is Perl has similar syntax.

Before you can create all this useful stuff you need to actually go out and get the Perl interpreter since it is a scripting language. Read more »

Using Variable Variables in PHP

When I was codeing I didn’t know how in the world I was going to be able to have incrementing variables in my code. That was until I searched the php.net website and came up with variable variables. I had no idea what these were until now. Read more »

Tracking UPS Packages with PHP

By now you should know how to look up a UPS rate with PHP. Now we are going to look into tracking the package using the UPS tracking XML API. This tool uses the same process as the rate selection tool so it should look familiar to you. Read more »

Adding dbase Support to PHP5 on Ubuntu

For the popular packages Ubuntu has handy little packages that will install/add extentions to PHP, but not for dbase. Dbase is old as dirt and most people don’t use it for much anymore. I was recently working on a legacy app that works with dbase files and this was the extension i needed to allow php to work with the old dbase system.

After searching online for awhile I couldn’t really find a good answer for how to add the extension without completely reinstalling PHP5 from source. Read more »

Validating an IP Address with PHP

For security purposes, all user input should be validated before accepting. In this case we are going to run a regular expression to determine whether or not an IP address is valid. This function could be used on forms or web applications where you ask the user for an IP address. Read more »

Validating Telephone Numbers With PHP

There are many different ways a user might input a phone number. Sometimes they may choose to input it as, (555) 555-5555. Other times they will use 555-555-5555. As a developer we never really know how they might input the number. Often times we can give our users an example and they will still enter the wrong format. Read more »

Using PHP to Accept Only Numbers From User Input

Almost all website attacks are caused by developers failing to sanitize user input. The standard security practice for handling user input is to “whitelist” it. Whitelisting converts ANY user input into the expected data type. For example if the input you are expecting is supposed to be a zipcode you need to create a script that will only except 5 numerical digits (9 if you support the +4 zipcodes). The more defined you can make your whitelist the more secure your script will be. If the user’s input cannot be converted to the whitelisted data type, in our case 5 numerical digits, then you return an error, “invalid zipcode”. Read more »

Creating a Secure Md5 Hash for Storing Passwords in a Database

Often times we, as developers are required to create authentication systems. When developing an authentication system it is always best to make it as secure as possible. One of the problems that arise when creating an authentication system is storing the username and password of our users. One way to store the username and password would be to simply make a column in a table called usernames and a column called password and store each user’s login credentials in plain text. Read more »

« Previous PageNext Page »