This class can be used to query arrays,html,xml or json file with a SQL-like syntax using LINQ.
It takes an array as parameter and can perform several types of queries using an SQL-like syntax as if the array was a relational database.
Currently it supports performing SELECT , DELETE, INSERT and UPDATE queries.
Example SELECT Queries:
========================
- SELECT *FROM myArray ORDER BY key DESC,value ASC,
- SELECT key,value FROM myArray WHERE value='100',
- SELECT * FROM json_file(my_json_file.txt),
- SELECT * FROM xml_file(http://tufyta.com/feed/).channel.item WHERE title LIKE '%linq%'
- SELECT *FROM html_file(http://tufyta.com).div WHERE class='post_title'
- SELECT *FROM text_file(data.txt) WHERE in_array('.line.',array(1,2,3,4,5,6,))
-SELECT * FROM dir_files(doc).files WHERE name LIKE '%D3Linq%'
- SELECT *FROM myArray.subitems WHERE name='Tufan'
- SELECT DISTINCT surname FROM personnels ORDER BY surname DESC
Example INSERT Queries:
========================
- INSERT INTO myArray (name,surname) VALUES ('Tufan','YILDIRIM')
- INSERT INTO myArray.subitems ('known_langs') VALUES ('PHP,C#,C++')
Example UPDATE Queries:
========================
- UPDATE myArray SET name='TUFAN' WHERE surname='YILDIRIM',
- UPDATE myarray.subitems SET known_lags='PHP,C#'
Example DELETE Queries:
========================
- DELETE FROM myArray WHERE name='Tufan'
- DELETE FROM myArray.subistems WHERE known_language LIKE '%PHP%'
This class can generate images for use in CAPTCHA based validation tests (Completely Automated Public Turing test to tell Computers from Humans Apart). It is an improved version of the Captcha Numbers class originally written by Hadar Porat.
This version can generate a random text string that includes letters and digits.
It can also display each of text characters in different vertical positions randomly defined.
The colors of the grid and the text characters alternate to make it more difficult for robots to guess what is the text written in the image.
New features as of 2006 March 7th:
- random pixel display (by default set to 10% of the pixels of the entire
image); if random selected pixel has background color then a random color is
selected for the random pixel, otherwise a close match of the letter's or
grid's color is generated
- removed grid display by default (it's better readable without the grid,
but it can be added, my suggestion is to add more dots instead of the grid)
- random grid color support
- added random display angle support
- added random font support
- added random font size support
- added random font color support
Improvements:
- replaced rand function calls with mt_rand (mt_rand suppose to be better
and faster, if I remember correctly)
Next to the class PHP file create a folder fonts and place TTF in order to use the random fonts feature.
Generate a form or formpart with a CAPTCHA picture
This class generates a picture to use in forms that perform CAPTCHA test (Completely Automated Public Turing to tell Computers from Humans Apart). After the test form is submitted a key entered by the user in a text field is compared by the class to determine whether it matches the text in the picture.
The class is a fork of the original released also in this site by Julien Pachet with the name ocr_captcha.
The following enhancements were added:
- Support to make it work with GD library before version 2
- Hacking prevention
- Optional use of Web safe colors
- Limit the number of users attempts
- Display an optional refresh link to generate a new picture with a different key without counting to the user attempts limit verification
- Support the use of multiple random TrueType fonts
- Control the output image by only three parameters: number of text characters and minimum and maximum size preserving the size proportion
- Preserve all request parameters passed to the page via the GET method, so the CAPTCHA test can be added to existing scripts with minimal changes
- Added a debug option for testing the current configuration
All the configuration settings are passed to the class in an array when the object instance is initialized.
The class only needs two function calls to be used: display_form() and validate_submit().
Optional-Class-Extensions:
hn_captcha_X1: add a garbage collector (for 'lost' images) to main class.
Since 24 December 2007, there are different classfiles for PHP 4 and PHP 5, ( merry x-mass <<<-| )
This class generates and display images with random text characters to perform a CAPTCHA test and verify whether the current site user is a real human or a robot script.
The class also displays a form with a text input to let the user enter the displayed characters to be verified.
The verification text length, size and color, as well as the background of the image that is generated, are all configurable parameters.
This class can generate images for use in CAPTCHA based validation tests (Completely Automated Public Turing test to tell Computers from Humans Apart).
It can generate an image with a random sequence of numbers over a grid of lines. The numbers and the grid are rendered in configurable colors. The numbers are rendered using a given TrueType font.
The image can be generated in either GIF, JPEG or PNG formats. The default format is PNG.