This function takes year as a parameter and returns a list of Holiday dates for that year. It returns an array of key/value pairs.

Example that prints out all of the US Holidays in the year 2014.

Date posted: July 16, 2014 | Author: | No Comments »

Categories: Programming Web

Do you need to filter input fields in your form to prevent users from filling them in incorrectly. Use this simple Javascript function to filter user input and remove invalid characters depending on the filter type. I have used this function in a few projects and does not require jQuery. You can easily add additional filter types to the function. The below example can filter integers and floats.

You can use this function by with Javascript events or directly in your HTML.

You can also change the event to filter input other events like onchange or onblur.

Date posted: July 8, 2014 | Author: | No Comments »

Categories: Programming Web

Parse HTML With PHP
Not all websites have a easy to use API for looking up information, but you can parse HTML for almost every website to extract data. PHP can be used to parse the DOM (Document Object Model) of HTML pages and extract data. In PHP 5 the DOM extension was introduced that allows manipulation of the HTML/XML DOM.

Continue reading Parse HTML Using PHP – Web scraping made easy

Date posted: July 4, 2014 | Author: | No Comments »

Categories: Programming Uncategorized Web

What is a SQL Injection?

SQL injection is a technique to attack database based applications. The attacker inserts SQL statements into an input field of the application for execution by the database. An application with a vulnerability can be used by an attacker to dump the contents of a database, delete the database contents, insert HTML code to perform Cross-site scripting (XSS) attack, and much more.

Continue reading Preventing SQL Injection in PHP

Date posted: June 21, 2014 | Author: | No Comments »

Categories: Programming Web

Are you have problems with automated SPAM bots submitting to your PHP form? This can easily be fixed by adding a CAPTCHA to your form. CAPTCHA stands for: Completely Automated Public Turing test to tell Computers and Humans Apart. The main purpose of a CAPTCHA is to distinguish human from a computer. A code or image is presented in a way that only a human would be able to understand, so say good bye to automated SPAM!

Continue reading Stop form spam by adding a CAPTCHA

Date posted: May 15, 2014 | Author: | No Comments »

Categories: Programming Web

This is a simple Javascript function to format a phone number.

Date posted: April 22, 2010 | Author: | No Comments »

Categories: Programming Web

You can use TCL/Expect to automate SSH logins to a remote server to execute a command on that server.
This automated login script can be modified to work with any command line program that prompts for passwords or user input. I have used similar scripts to automate CVS logins and updates, and I have automated many other tasks in linux. The following example will SSH into a server and restart apache.

Continue reading Automated Login Script Using Expect

Date posted: April 16, 2008 | Author: | No Comments »

Categories: Linux Programming

This is a simple function that validates a given phone number and if it is valid it returns it in the form xxxxxxxxxx.

Date posted: February 2, 2008 | Author: | No Comments »

Categories: Programming Web

This is a shell script that I wrote that checks the Qmail mail queue size and if it is above a given number it will send an email alert. With this handy script you can be notified of when your mail queue is filling up before you run into problems. This can easily be added to a cron job. You may have to change some of the script to make work on your system.

Continue reading Plesk mail queue notifier script for qmail

Date posted: December 24, 2007 | Author: | No Comments »

Categories: Linux Programming Web

Copyright © 2013, Neil Bittner. All Rights Reserved.