WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : PHP Round Clock - Must have Gif support to use this.
Categories : PHP, Date Time, Graphics Update Picture
Jan Prochazka
Date : Feb 18th 2001
Grade : 3 of 5 (graded 2 times)
Viewed : 5755
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Jan Prochazka
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?
/*
* PHP Clock
* v. 0.9.2
*
* 24-11-2000 18.45
*
* (C) 2000 prochazka@cernosice.cz
*/

Header("Content-type: image/gif");
Header("Expires: ".GMDate("D, d M Y H:i:s")." GMT");

$th = ((Date(U) % 43200)+3600) / (4320/2*PI());
$tm = Date(U) % 3600 / (360 /2*PI());
$ts = Date(U) % 60 / (6 /2*PI());

$sirka = 100; // width
$vyska = 100; // height

$stredx = $sirka/2; //center x
$stredy = $vyska/2; //center y

$r = min($sirka, $vyska)/2-(min($sirka, $vyska)/10);

$img = ImageCreate($sirka,$vyska);
$color = ImageColorAllocate($img, 58, 110, 165);
ImageFill ($img, 0, 0, $color);

$color = ImageColorAllocate($img, 255, 255, 255);

$hx = $stredx + $r*0.60 * sin($th);
$hy = $stredy - $r*0.60 * cos($th);
$mx = $stredx + $r * sin($tm);
$my = $stredy - $r * cos($tm);
$sx = $stredx + $r * sin($ts);
$sy = $stredy - $r * cos($ts);

$colorcopy = ImageColorAllocate($img, 102, 153, 204);
$colorcopy2= ImageColorAllocate($img, 163, 193, 224);

ImageString ($img, 2, 5, 5, Date("H:i:s"), $colorcopy);

for($i=0; $i<12; $i++)
{
$bod = $i / (1.2/2*PI());

$bodx = $stredx + ($r*1.0) * sin($bod);
$body = $stredy - ($r*1.0) * cos($bod);

Imagesetpixel($img, $bodx, $body, $color);
}

ImageLine($img, $stredx-2, $stredy, $hx-2, $hy, $colorcopy);
ImageLine($img, $stredx+2, $stredy, $hx+2, $hy, $colorcopy);
ImageLine($img, $stredx-1, $stredy, $hx-1, $hy, $colorcopy2);
ImageLine($img, $stredx , $stredy, $hx , $hy, $color);
ImageLine($img, $stredx+1, $stredy, $hx+1, $hy, $colorcopy2);

ImageLine($img, $stredx-1, $stredy, $mx-1, $my, $colorcopy);
ImageLine($img, $stredx+1, $stredy, $mx+1, $my, $colorcopy);
ImageLine($img, $stredx, $stredy, $mx, $my, $color);

ImageLine($img, $stredx, $stredy, $sx, $sy, $color);

ImageGif($img);
?>



Simple graphic clock/watch generation using gd library.
Categories : Graphics, Date Time, PHP
Shows the current time as a PNG-image. This script does not use the GD library. You can use it as a benchmark (because it's slow), or as a quick reference for implementing a simple PNG-file generator.
Categories : Graphics, Zlib, Calendar, PHP, Date Time
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics
Select with current month
Categories : PHP, HTML and PHP, Date Time, Arrays
Calendar using Date function
Categories : HTML and PHP, PHP, Date Time, Calendar
A couple of functions that convert an IP address into its color code and not-color-code. Useful when viewing an apache log with a mysql result grouped by IP
Categories : PHP, Graphics, Databases
How to display any array in several rows and columns of a table. Not just in one column or in alternate rows. This example shows a nice color table generated with PHP, but can be used with any array values(e.g. Database)
Categories : Arrays, PHP, Miscellaneous, Beginner Guides, Graphics
Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality.
Categories : PHP, GD image library, Graphics
A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed.
Categories : Date Time, PHP, Complete Programs, Calendar
webcam cam view image ispy browser independant
Categories : Graphics, HTML, HTML and PHP, PHP
A Timing Class
Categories : PHP, PHP Classes, Date Time
PHP Email image generator - hide your email from bots - using the GD Library
Categories : PHP, Graphics, GD image library, Beginner Guides
Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used.
Categories : HTML and PHP, PHP, Date Time