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
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
Mobile Dev World

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 : 9463
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
Calendars to choose a range of dates , reservation events ...
Categories : PHP, Calendar, Java Script, Date Time
Upload images restricted by pixel size (Picture width and Picture Height)
Categories : PHP, HTML and PHP, Graphics
Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example.
Categories : PHP, Date Time, PHP Classes, Calendar
3dLib - a class for drawing in 3D space. Supported functions: Line, SetPixel, Polygon, FilledPolygon, etc. 3dChart() function has been added for one-call drawing of 3d charts. Support of mostly used 3d-transformations.
Categories : Graphics, Math., PHP Classes, PHP, Charts and Graphs
Function to convert Arabic numbers into Roman Numerals
Categories : Algorithms, PHP, Date Time
Generate image with random number (CAPTCHA)
Categories : PHP, GD image library, Graphics, Security
Functions for loading images into a MySQL database and displaying them.
Categories : Graphics, HTML and PHP, MySQL, PHP, Databases
function to generate calendars on the fly.
Categories : Calendar, PHP, Date Time
Monthly and Daily Upcoming Events calendar.
Categories : Date Time, PostgreSQL, PHP, Calendar, Databases
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics
GetImageSize -- Get the size of a GIF, JPEG, PNG or SWF image
Categories : PHP, PHP Functions, Graphics