PHP Table Class
5
Cyber-Drugs
Below is a very simple bit of code you can use to test a MySQL Database Connection.
5
Before any wars start, I want to clarify that the code below is NOT my own code, but unfortunately I am uncertain where I obtained it from. The code below basically create dynamic thumbnails of an image, you parse the following to it:
Image location,
Maximum Width
Maximum Height
It will then scale your image down, please do not confuse this with converting your image into a square, or whatever shape you are after. The code below will maintain aspect ratio of your image, and will use the values you parse as a guidline. Extremely handy when you are building gallery websites.
Image location,
Maximum Width
Maximum Height
It will then scale your image down, please do not confuse this with converting your image into a square, or whatever shape you are after. The code below will maintain aspect ratio of your image, and will use the values you parse as a guidline. Extremely handy when you are building gallery websites.
9
The below may be a simple line of code, but it is extremely useful to help prevent SQL Injection. There are many other methods, such as removing certain values from your string, but this is by far superior, as it does not limit what can be inserted to your database.
15
A small recursive php function to determine the size of a directory by adding all it's contents together and returning them as an integer.
12
This function is useful in helping to deter spam bots by obfuscating things such as e-mail addresses and URLs that are displayed on a web page. While it's not 100% fool proof, it does offer some protection.
Example:
$email = html_entitize('foo@baz.org');
/*
Outputs foo@baz.com
*/
Example:
$email = html_entitize('foo@baz.org');
/*
Outputs foo@baz.com
*/
21
A quick and simple function to dump a variable (array, object, string, int, etc) out into -formatted output for a web browser.
If the variable is an array or an object, you can have it returned into the another variable for later processing (i.e., through templates or e-mail). Due to lack of free time, if the variable is not an array or an object, it will ignore the $return value and print directly to output.
Future revisions will add the above mentioned functionality.
If the variable is an array or an object, you can have it returned into the another variable for later processing (i.e., through templates or e-mail). Due to lack of free time, if the variable is not an array or an object, it will ignore the $return value and print directly to output.
Future revisions will add the above mentioned functionality.
9
Grab a remote web document using sockets, with limited handling for 301 & 302 redirects.
12
Given a PHP array (even a deep nested array), returns a string representation of that array as JavaScript array. Useful when using PHP to output JavaScript.
10
A function that will either read a file or read a string, and parse a random line from it. Very simple.
11
You can use this function to dynamically generate html "width/height" for use with displaying a thumbnail image usingthe original image. This will help save in making dup images just for display as a thumbnail.
It takes two arguments, the path to where the image is stored and the desired width or height.
Please comment or improve this code
.
It takes two arguments, the path to where the image is stored and the desired width or height.
Please comment or improve this code
. 








