Syndicate content

PHP, JavaScript, Perl

Create a select input box in PHP

Description

  • Many times in PHP you find yourself creating a <select> input box. You might need some default option already selected, or you might want to populate the options with values from an array. These instructions will show you an easy way how to create and populate the list on-the-fly.

Simple PHP single user login script

Description

  • This is a login that can be used on any existing PHP file. The login uses a single username/password set and does not require a database. Setup is as simple as adding a few lines of text to the top of any PHP page to force a login.

PHP MySQL wrapper v3 - PHP5 Singleton Class to easily call mysql functions

Description

  • This is not a full script. This is the PHP singleton class (PHP5 specifically) that I use to make all the MySQL database calls in my projects. I run all my MySQL connections through it because it saves me time and space on my code. I don't have to keep typing the database information and other things like that. It also has shortcut functions because I got tired of escaping data, stripping slashes, building UGLY insert and update queries. I'm sharing this class along with some examples for using it.

What is a Singleton and why use it?

  1. A Singleton in PHP allows you to create a single object ($db) and reuse that same existing object anywhere in your code.
  2. This allows you to easily reuse the same database connection inside of other functions/classes. Without a singleton, your options would be to either declare the $db object as a global inside every function, or pass the $db object into the function via a parameter. A Singleton object eliminates all this.

PHP User Login and Management

Description

  • These files are considered BETA. They are not fully developed or documented and are not ready for public use. However, several people have expressed interest in them so I am putting them up for anyone to play with.
  • This is a database driven user management structure. It allows the creation of multiple users with different levels of permissions. The login class is a singleton that can easily force a "login" on any php file.

PHP MySQL wrapper - PHP Class to easily call mysql database functions

Description

  • This is not a full script. This is the MySQL class that I used with PHP4 database projects. I ran all my MySQL connections through it because it saves time and space on code. I don't have to keep typing the database information and other things like that. It also has shortcut functions because I got tired of escaping data, stripping slashes, building UGLY insert and update queries. I'm sharing this class along with some examples for using it.

PHP Thumbnail Image Gallery Script

Description

  • This is an image gallery script that allows you to simply upload new full sized images in FTP and the script will automatically create the thumbnails for those images and add those images to a paged thumbnail gallery suitable for browsing.

ricosend

Description

  • ricosend is a formmail-type PHP script to email the results of a form on a website
  • Created because I needed a script that was fairly simple and was more secure than most existing scripts.

Dynamically created Image with server uptime and load

Description

  • This is a php script that will allow you to create a png image (for a signature or just in general) that will dynamically display your Linux server's uptime (days, hours) and load (current, last 5 mins, last 15 mins)

Time Since Page Last loaded

Description

  • Timer logs then displays the number of days, hours, minutes, and seconds since the page was lasted loaded by a visitor.

Error Lumberjack

Description

  • Error-Lumberjack (dumb name, i know) is a CGI script allows you to log the Apache errors your site receives (page not found, server error, access denied, etc). It also displays a custom error message for each error. Includes complete administration options.