PHP Modules

Flood Blocker

This class can be used to detect and protect a Web site from attempts to flood it with too many requests. It also allows to protect the site from automatic downloading many pages or files from the same IP address. The detection of flood is determine according to a set of parameters indicating the maximal allowed number of requests for the certain time interval. It is possible to set several parameters at once in order to perform more effective protection. Download

Secure Session

This class can be used to prevent security attacks known as session hijacking and session fixation. When a session is initialized the class computes a fingerprint string that takes in account the browser user agent string, the user agent IP address or part of it and a secret word. If the fingerprint value changes, it is very likely that the session was hijacked and it should no longer be accepted. To prevent session fixation attacks the calls the PHP session_regenerate_id() function so the session identifier changes everytime the session is checked. Download

Image Batch Processor

This package can be used to apply graphical operations on a set of image files. It provides one class that has variables with values that define parameters of the supported graphical operations on each of the files to be processed. The main class can iterate over the list of files and apply each of the defined operations. Currently it can proportionally resize images to create thumbnails, rotate images, convert between different image formats, append textual labels or add watermarks. Download

Thumbnail Image

This class can resize images to generate thumbnail versions. It can generate thumbnail images keeping the proportions between the width and the height. It may also add optional text labels with a given color, font, size, rotation angle and position in the resized images. It can load images from files of any format supported by the GD extension and generate thumbnails in either JPEG, PNG or GIF formats. The resized images can be saved to a given file or served directly to the user browser. Download

PHP Interface to Webmoney

This package can be used to submit payment requests to the Webmoney.ru or wmtransfer.com sites. It can setup a Web form with all the details to submit a payment request. It can also validate and handle responses to payment pre-requests, notifications and results. Download

RSS Feed Generator

This package can be used to generate RSS 2.0 feeds. There are separate classes for the RSS XML document, the feed channel definition, the feed items definition, the search text input definition and the feed logo image definition. The compose a RSS feed it is necessary to create object a RSS feed channel object and add item objects to its definition. The RSS feed XML document is generated by an RSS feed object given a previously created channel object. Download

Print Anything

This class can be used to make a browser print a given HTML document. It generates HTML with special Javascript code and CSS style sheet that includes the whole page in a non-printable section and adds a new page section with given HTML that you want to print, but it is not displayed in the browser. The class can also generate links of form buttons that when clicked trigger the execution of the generated Javascript code making the browser printing dialog open to print the HTML document section that it is intended to be printed. Each page may have multiple print links or form buttons to print distinct HTML documents. Download

MySQL Backup

This class can be used to backup MySQL database to files that contain SQL statements to recreate the database. It can backup whole databases or individial tables. Optionaly it may backup only the structure of tables without data. It can create files that may optionally be compressed with the gzip algorithm. The generated backup files can be saved to a server side file, returned as a string of SQL statements or served directly for download. Download

MySQL Restore

This class can be used to execute batches of MySQL database queries read from files or text strings. It can be useful to restore backups of MySQL database that generate SQL query lists meant for that purpose. The SQL data can be compressed with gzip algorithm. The class can also build an array of queries strings in a class variable without executing the queries. Download

Private Sessions

This class can be used as session handler to store session data in private directories or in a MySQL database table, instead of the default system temporary directory. When using a MySQL database table as a container for the session data, the class takes care of opening the database connections and perform the SQL queries as needed. It can also create the database table to store the session data. When using a private directory as a container for the session data, the class takes care of opening, reading and writing to the session files as needed. Download

DBWrapper

This class is a MySQL database access wrapper. It can: establish connections of a given MySQL server; execute SQL queries; retrieve query result rows individually or all at once into arrays; retrieve the last inserted identifier, affected table rows, total result set rows and result set columns. Download

CCValidator

This class can be used to validate credit card numbers. It checks the integrity of the number by using the mod 10 algorithm. The class can also check a credit card number of a given card type by looking at the number prefix. Currently it can check whether the card type is: VISA, Mastercard, American Express, Diners Club, Discover or JCB. Download

AIRProjectXML

This package can be used to read and write Adobe AIR application files. It provides classes for composing several types of elements of AIR projects such as windows, icons, file types, applications, as well classes for parsing and generating AIR XML project definition files. The package also comes with Web based user interface for managing AIR project files. Download

YouTube Parser

This class can be used to determine the URL to download the video stream of a YouTube video. It takes the URL of a page of YouTube video, parses the page and determines the URL download the Flash video stream directly. Download

Google Checkout Button

This class can be used to generate HTML for forms to let the user submit shopping cart contents to Google Checkout. It can take several parameters to define the shoping cart items and respective discounts, shipping method and tax rates. The class generates HTML for a form that includes all the shopping cart parameters. The generated form may be submitted to the real Google checkout server or the sandbox server. Download

Google WAP Dictionary

This class can be used to provide a Web interface suitable for mobile devices to translate text between idioms. It generates Web interface in XHTML or WML with a small form to let the user enter text to be translated between two idioms. The class accesses the Google translate service pages and emulates the submission of the text translation form. The class parses the results and reformats them to display small mobile device screens. Download

Project Estimator

This class can be used to count the number of lines and characters contained in the files of a project. It can traverse a given project directory recursively and process files that match a given file name pattern. The class counts the number of lines of the matched files and the total number characters excluding white space or just considering alphabetic characters. The class can also display the statistics in a Web page. Download

ChiliHighlighter for PHP

This class can be used to highlight code in PHP or other languages using the JQuery Javascript library. It generates HTML tags with Javascript that users JQuery and its plug-ins to highlight a given piece of code in a Web page. Currently it supports the languages: C++, C#, CSS, Delphi, Java, JavaScript, LotusScript, MySQL, PHP and XHTML. The class can highlight code given as a string or read from a server side source file. Download

Resources Manager

This class can be used to provide a Web interface to manage files stored in a server directory. It can perform several types of basic operations on the files like listing, sorting, uploading, renaming and deleting. The class can be used to provide an interface with texs in different idioms. The presentation of the interface can be customized by adapting an external template script. Download

MyPager

This class can be used to display navigation HTML links to split listings in multiple pages. It can takes as parameters the number of listing entries to display per page, the total number of entries and the number of the first entry to display in the current page. It can display links to go to the first page, previous page, next page and last page, as well links to intermediate page links upto a configurable limit number of links. It may also display an informative message to mention the range of entries displayed in the current page like this "Display 144-174 of 350". Download

FileSyncDB

This class can be used to manage MySQL database table records synchronized to files stored in disk. It can insert, updated and delete records of a database table with fields that contain the names of associated files. When a record is inserted or updated the associated files are copied to the disk using the given file names. When a record is deleted, the associated files are also deleted from disk. Download

Extended PHP Mailer

This class can compose and send e-mail messages with support for defining the message body text from a template file. It can send text or HTML messages. The messages may have attached one or more attached files. It may also encode the text of the headers and body in several character sets to be sent according the e-mail standards. Download

Smart Counter

This class can be used to count the number of visitor of a site using a MySQL database table. It can keep track of the total visitors of a site, visitors of a given page, visitors in the current day and the active visitors (access in the last 5 minutes). The visits of users of the same IP address are only counted after ending a given period of time (20 minutes by default). The visitis statistics are stored in two MySQL database tables with configurable names. The class can also create these tables if they do not exist already. Download

Source Parser

This class can be used to parse text BBCode style tags like [PIC="logo.gif"], [IMG PIC="photo.jpg" BORDER=0], [B]text[/B] etc. It invokes given calllback functions when open and close tags are found passing the attributes of the tags. The callback functions can return text that is used to replace the tags that are found. Optionally, the class can turn URLs and e-mail addresses into HTML links. The e-mail addresses can be encoded using Javascript to prevent harvesting by robots. Download

PHP Parameters List

This class can be used to store and retrieve persistent session values that can be recovered even after sessions expire. It uses PHP sessions to store the values while the user navigates in the site. It uses cookies to store the values for specified period of time (10 days by default), so that those values can be recovered when the user visits the site later using a new session. Download

Valid Markup

This is a very simple class that can convert the HTML output of a page to XHTML using the Tidy extension. It starts output buffering using the ob_tidyhandler function as filter to make it regenerate the current script HTML output to make sure it is formatted as XHTML. The class may set the DTD to one of several possible HTML and XHTML versions. Download

Concurrent Code Rotator

This class can pickup a random text from multiple random alternatives. The text may be code in PHP, HTML, Javascript, etc., for instance to serve rotating advertisements. It uses special random number generation algorithm which allows to control the frequency and probability of appearance per working cycle. Download