Anonymous Proxy check
9
Grab a remote web document using sockets, with limited handling for 301 & 302 redirects.
9
This is a rewrite of a basic ADODB / PHP Database pager. This pager has some very slick search, sort, and display configuration options. Modifications and improvements are very welcome. Thus I am sharing this code.
A basic example for using this pager would be as follows:
// Check class code for CSS styles used
require_once ('class.init.php');
// SQL Statement
$sql = 'SELECT table1.field1, table1.field2, table1.field3 FROM table1';
// Field Labels
$label_arr = array (
'field1' => 'Field 1 Heading',
'field2' => 'Field 2 Heading',
'field3' => 'Field 3 Heading'
);
// Hidden Fields
$vsel_arr = array (
'field3' => 0 // don't display field3 unless requested by the user
);
$sort_arr = array (
'field1' => 'asc' // sort by field1 ascending order (asc) or (desc)
);
// Config array
$config = array (
'db' => &$dbconn, // open ADODB connection
'sql' => $sql, // String of sql
'id' => 'table1_pager', // pager id for session variables
'label_arr' => $label_arr, // field heading array
'vsel_arr' => $vsel_arr, // fields to hide
'extra_param' => '', // extra paramaters to pass with edit, delete, add anchors
'form_width' => '100%', // table with
'form_title' => 'Table 1', // table title
'edit_anchor' => 'Edit', // link to edit
'del_anchor' => 'Del', // link to delete
'add_anchor' => 'Add', // link to add
'print_anchor' => 'Print', // link to print
'header_view' => true, // no function at this time
'search_view' => true, // no function at this time
'pk' => array ('field1' => true), // primary key field
'sort_arr' => $sort_arr, // sort field array
);
// create object then render it ...
$_pager = new pager($config); // create instance
echo $_pager->render(25); // render output
A basic example for using this pager would be as follows:
// Check class code for CSS styles used
require_once ('class.init.php');
// SQL Statement
$sql = 'SELECT table1.field1, table1.field2, table1.field3 FROM table1';
// Field Labels
$label_arr = array (
'field1' => 'Field 1 Heading',
'field2' => 'Field 2 Heading',
'field3' => 'Field 3 Heading'
);
// Hidden Fields
$vsel_arr = array (
'field3' => 0 // don't display field3 unless requested by the user
);
$sort_arr = array (
'field1' => 'asc' // sort by field1 ascending order (asc) or (desc)
);
// Config array
$config = array (
'db' => &$dbconn, // open ADODB connection
'sql' => $sql, // String of sql
'id' => 'table1_pager', // pager id for session variables
'label_arr' => $label_arr, // field heading array
'vsel_arr' => $vsel_arr, // fields to hide
'extra_param' => '', // extra paramaters to pass with edit, delete, add anchors
'form_width' => '100%', // table with
'form_title' => 'Table 1', // table title
'edit_anchor' => 'Edit', // link to edit
'del_anchor' => 'Del', // link to delete
'add_anchor' => 'Add', // link to add
'print_anchor' => 'Print', // link to print
'header_view' => true, // no function at this time
'search_view' => true, // no function at this time
'pk' => array ('field1' => true), // primary key field
'sort_arr' => $sort_arr, // sort field array
);
// create object then render it ...
$_pager = new pager($config); // create instance
echo $_pager->render(25); // render output
9
This is a Tiny PHP Uploading script. It SHOULD be safe from both really large files and non-image files.
9
Get File Size
9
Change the case of an array.
10
This simple function will check if a url is valid (going by parse_url()) and if it's 'online' - by seeing if it returns a 302, 301, or 200 status code.
10
How Long Has It Been Since a Certain Date?
10
The below code will generate a form dropdown for all the days of the month, with today's day selected. Handy for those date pickers!
10
Here is a pair of function to use in combination. The first one will change newlines into tags to store into a database. The second one does the reverse so you can edit the content of the database without having the tags show when you edit the content. If you can find improvements or have comments please let me know
10
Give this little function a start date and number of days and it will calculate the end date.









