All Scripts backed by 10 years in business, free support, free updates and a 30 day money back guarantee.
Download Purchase Programming F.A.Q. Support Contact
Commercial Perl Scripts
All Form Pro Updated
Count It
Form Mailer + Attachments
Client File Manager
Da Godfaddah
Dropbox Updated
FAQ Builder
HT Manager Updated
Mailing List Server
Page Updater - Text
Page Updater Pro Updated
PS Lightning Search Updated
Quick File Mailer
Quick MySQL
Upload Center
Free Perl Scripts
Access Log Viewer
All Form
Epoch Converter
Error Log Viewer
Invoice Center
PS Upload
Question Manager
Site File Finder
Site File Lister
SSI Tag Maker
Perl Modules
Monger Calendar
Monger File
Monger Mail
Monger Persist
JavaScript Generators
PopUp Windows
Meta Gen
RGB / Hex Converter
Page Colors
Tutorials and FAQs
Using CuteFTP
Using WS_FTP
Installing Scripts
Free Services
Epoch Converter
TLD Registries
RGB/Hex FInder
Colour Checker
Terms and Conditions
Privacy Policy
Refund Policy
Site Map

Form Processor with no SPAM from robots.

Manage Remote websites from your website. Allow clients to update sections of their own web pages.

Secure file manager with upload progress meter. A printer's best friend. Find out more.

Utility Name:
Platform: UNIX or Linux
Requires: Perl4 or higher

If your programs require that the end users enter a url, you have to make sure it is being input in the correct format. Especially if this URL is going to be displayed on a webpage as a link. If the URL is not entered with the "http://" at the beginning, the link won't work. Try it for yourself and you will see that hypertext links don't work if there is no "http://" at the beginning of the URL.

This utility takes away the need for instructions to the user or for you to try and figure out the RegExp to check this. I've done it for you.

Here is how you use this utility:

Either cut and paste this subroutine into your own script or "require" this file by placing it in the same directory as your script and placing the following line anywhere before the subroutine is first called:

require '';

Now you are ready to use it. The subroutine needs one parameter passed to it. This is the URL you want the format checked for. The subroutine will take any URL that does not have or is incomplete (ever typed "htp://" or "http:/" by mistake?) and return a properly formatted URL.

$good_url = format_url($check_url);

$good_url will be properly formatted:

What errors will it pick up? Here is list of what the subroutine will trap and correct:

  • /
  • //
  • ://
  • p://
  • tp://
  • ttp://

....or an combination of errors prior to the last forward slash.

Examples of valid calling formats:

$good_url = format_url($check_url);

$good_url = format_url("$check_url/$variable1/$variable2");

NOTE: This subroutine does not check to see if the referenced file actually exists, it only checks to see if the URL has the "http://" at the front of it.

S  T  O  P  !  !  !

This sub-routine does not support secure URL's. That is, URL's that have "https://" instead of "http://". Therefore, use your skills to create an alternate sub-routine to handle just secure URL's or if you are REALLY ambitious, use this sub-routine to create a new sub-routine that handles both secure and non-secure URL's. It's only mildly tricky!!
  ©2009 All rights reserved, Website hosting by