WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
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 Resources
Web Development Content
Internet Security Software
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
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

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 3 times)
Viewed : 12768
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  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);
?>



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
Simple graphic clock/watch generation using gd library.
Categories : Graphics, Date Time, PHP
a simple pie-chart in php3 (with gd)
Categories : PHP, Graphics, GD image library, Charts and Graphs
This script contains 2 functions: 1 to create html select object based on your own customer date format entry- "M d Y h:i.... etc". The second function processes the select object on submit back to unix time.
Categories : PHP, Calendar, Date Time, HTML and PHP
Simple function to return the number of days in a time span between 2 given dates.
Categories : PHP, Date Time, MySQL, Databases
Display a bar chart based on random values.
Categories : Graphics, PHP, GD image library, Charts and Graphs
Website colour changer
Categories : PHP, HTML and PHP, Date Time
Calendar, Kalender, date, time, day, month, year
Categories : PHP, Date Time, Calendar
Simple way of scaling any image to fit either given width or height.
Categories : PHP, Graphics, Arrays
Convert date's in YYYY-MM-DD (i.e. mysql format) into PHP3 timestamps. Also Find the difference in days between two PHP3 timestamps.
Categories : HTML and PHP, PHP, MySQL, Date Time
Calendars to choose a range of dates , reservation events ...
Categories : PHP, Calendar, Java Script, Date Time
List people whose birthdays fall on the current Day and Month
Categories : Databases, Date Time, MySQL, PHP
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
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