Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
create buttons on the fly with PHP3 and now also PHP4. <br>variables used: fg:foreground color, bg:background color, txt:text on the button.<br>
<a href="http://www.circle.ch/scripts/" target="_blank">http://www.circle.ch/scripts/</a><br><br><ul><li>
Refer to my other example to see, how fonts can be changed: <a href="http://www.zend.com/codex.php?id=188&single=1" target="_blank">http://www.zend.com/codex.php?id=188&single=1</a></li>
<li>See also the cascading menu using images: <a href="http://www.zend.com/codex.php?id=232&single=1" target="_blank">http://www.zend.com/codex.php?id=232&single=1</a></ul>
|
|
I wrote three basic routines to create an image, draw a frame and add a text-line to the image. most parameters are http-passed; this allows a later inclusion into your html-documents.
have a look!
|
|
Random Image with Link - good for "did you know" type of banner which point people to new areas of a website (at least that's why I made it...)
**** This uses $level from my code for the link level determiner ****
|
|
A simple function to avoid having to specify image height and width when putting an image in a web page. Specifying these parameters helps the browser display pages faster.
|
|
Generate "Mondrian" art randomly.
|
|
When accessed via the tag:
Where $barcode is the string with your
information to be barcoded, it returns a pnd image of the barcode. It creates a barcode39 type barcode.
|
|
This script makes it easy to dynamically
buttons by applying text to images. The text can have different font, color, angle
and background image
|
|
a cascading menu using on-the-fly image creation.<br>inspired by macromedias flash and sun's java you get now another possibility to create<br>dynamical menus.<br><br>thank you zakj, for your <a href="http://www.zend.com/codex.php?id=230&single=1" target="_blank">menu class</a>.
<br>See example:<a href="http://www.circle.ch/scripts/test/button_menu/" target="_blank">Cascading menu</a>.
<br><br>enjoy!
|
|
Takes a hex colour in standard HTML format and returns a three element array in which each element is the decimal R, G, or B value which can then be used, for instance, in GD funcitons
|
|
Class to draw a text message as a PNG graphic. The text message, font, colour, background, size, padding, rotation, and transparency can all be defined via OO interface. Code below can be called as a URL.
|
|
JavaScript and PHP server communication via the document.images object in the html DOM.
|
|
This class allows you to crop an image in a variety of ways. You can crop in an absolute or relative way (to a certain size or by a certain size), both as a pixel number or a percentage. You can also save or display the cropped image. The cropping can be done in 9 different positions: top left, top, top right, left, centre, right, bottom left, bottom, or bottom right. Or you can automatically crop based on a threshold limit. The original image can be loaded from the file system or from a string (for example, data returned from a database.)
The script attempts to auto-detect the GD version, so you should be able to use GD 1.6 and on up.
|
|
This PHP script will display the daily comic from the well-known User Friendly site (www.userfriendly.org).
|
|
Class that utilizes gd library to retrieve image info and preview an image dynamically. Also have a look at the example code
|
|
This code radomly selects and image from a directory and with the aid of META refresh rotates images on a page in a slideshow fashion. The code will function fine without the META refresh enabling a different image to be viewed upon page refresh. The script generates a valid IMG tag including graphic dimensions. Will accept either GIF or JPEG formats. This code should be compliant for both PHP 3.x and PHP 4.x
|
|
Embed Flash swf's in php using a function call from another php file
|
|
ok, well as you may have noticed, imagepstext, and imagettftext do not word wrap. I ended up writing THIS code to combat that, and also to help in ALL my sites. With very little work it can be changed to do lots of cool things with text. This SHOULD work, i dont THINK it is an older copy...
|
|
This function allows you to grab an image from a remote host and write it
into a new file in the local host.
|
|
Creates a html document which resembles a gif file. requires gd.
|
|
Well, I was shifting from GD with GIF to a newer without GIF, but I had one problem. I had to convert about 2000 GIF files into PNG... that was bad. So I did a little code, that did the work for me. It can easily be rewritten so it also can handle etc. JPEG.
|
|
A graphical companion to The <a href="http://www.zend.com/codex.php?id=234&single=1">Anticounter</a>. More silliness.
|
|
Hotlinking protection support from PHP:
This simple script is an easy way to protect your media images or any files for that matter from remote linking which leads to bandwidth theft.
|
|
"Cache" dynamically created images.
|
|
A helpful collection of image processing routines. Some convert between colour spaces and others process the image. This library makes it really easy to change the hue, saturation, brightness, and colour of an image, as well as easily create html hx colour strings, or get the rgb value of a pixel, and more!
Methods include:
getGDVersion(), getPixelRGB(), colourDistance(), hex2rgb(), rgb2hex(), rgb2hls(), hls2rgb(), rgb2hsv(), hsv2rgb(), greyscale(), threshold(), colourise() (also accessible as 'colorize')
Full details of these methods, and examples of use, can be found in the class comments.
|
|
This is a class allows you to apply a mask to an image much like you could do in PhotoShop, Gimp, or any other such image manipulation program.
If the mask is smaller than the image then the mask can be placed in various positions (top left, left, top right, left, centre, right, bottom left, bottom, bottom right) or the mask can be resized to the dimensions of the image.
Because of the nature of the class, masking large images may take some time!
|
|
Inspired by the RSA dolphin and a giant Tux also made of coloured source code.<BR>Turn any png, jpg or gif (if supported by your version of GD) into coloured HTML Text.
|
|
Image to HTML Text Converter Class
|
|
copy a part of an image to another one and saves it to the disk
|
|
A set of filters that works around the image index, changing it like grayscale filter and sepia filter. It requires uses GD.
|
|
This PHP class takes a local file as its input and will determine
if the file is a BMP, GIF, JPEG or PNG. It will also extract
other generic information about the image, including resolution,
height and width (without using the builtin GetImageSize() or any other PHP extensions)
as well as other image type specific information.
|
|
A function for caching images generated by php/gd.
|
|
This is some code I whipped together that creates an imagemap from an image that if you hover your mouse over it, the color you hover over will be displayed in a text box.
This could be useful for working with a color wheel when asking people for color entries in web apps.
|
|
This is an extension of the crop canvas class (http://www.zend.com/codex.php?id=1315&single=1) which provides an interactive cropping area for an image. Very easy to use and implement drag & resizing GUI interface, built using JavaScript.
All required files can be found at: http://php.amnuts.com/index.php?do=view&id=12
|
|
Code is simple but it works, normal non optimized jpegs will become small and fast loading site friendly jpegs.
note: can be used with gd lower than 2.x and images will remain to be clear and undistorted
|
|
View images in directory
|
|
My very first programming in PHP - I know the comments are missing, but play around with it.<BR>
Data has to be put into arrays, parameters have to be set manually.<BR>
Included is a font-smoothing routine etc.<BR>
<BR>
needs gd & libpng<BR>
<BR>
comments? -- frank@boehm.to<BR>
<BR>
fixed the link [07.09.2000]
|
|
used to generate a transparent or colored pixel.<br>
<b>syntax:</b><br>
<img src="phpixel.php3"> for a transparent pixel<br>
<img src="phpixel.php3?c=ff0000"> for a red pixel<br>
no gd library needed... only pure php<br>
|
|
combination of several code snipplets to have your visitor upload a picture and some comment + show a listing on the same page
|
|
Publish all images of a directory automatically.
Add title, description, home-link.
Exclude files of your choice.
|
|
Generates a random image link from an image directory.
|
|
Simple php random picture, every time you reload the site it changes the
picture. Simple but effective.
|
|
If you have a message board which allows people to post inline images with the IMG tag, you can use this function to run a few checks on the remote image. Simply pass it the URI to the image, and it checks the file exits; that it is a recognised image format; and that it is smaller than a predeterminted size. This stops mischief-makers linkng your page to a 4TB file.
|
|
showing in directory images
|
|
Simple PHP Image Counter
by Hunje Cho
|
|
a class to generate stars given a radius and the amount of points on the star
|
|
A little function for stripping images from HTML contained in a variable.
|
|
Very simple class to use to write text on an image. Supports GIF, PNG, and JPEG. GD must be compiled with php.
For the following example, provide your own image please.
Example:
=========================
$config=array(
"text" => "123456",
"text_colors" => "0 0 0", // RGB Seperated by spaces
"image_loc" => "coupon.jpg",
"image_type" => "JPEG", // PNG and GIF Supported
// Optional arguments; default is center area on image
"x_pos" => "",
"y_pos" => "",
);
$graphic=new img_add_txt($config);
|