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 : Simple graphic clock/watch generation using gd library.
Categories : Graphics, Date Time, PHP Update Picture
Christophe Lauer
Date : May 05th 1999
Grade : 3 of 5 (graded 8 times)
Viewed : 15052
File : AnalogClock.php3
Images : No Images for this code example.
Search : More code by Christophe Lauer
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php

// AnalogClock :
// This small PHP3 script has been written by Christophe Lauer
// (mailto:clauer@citeweb.net) to serve as an example for libgd.
//
// Feel free to use it as you like, you're even allowed to say
// it's your's if you like... Mail me if you like it, or if you
// can write it shorter. Comments are welcome ;-) This is emailware
//

function draw_radius($img, $x, $y, $r, $ang, $col)
{
$x1 = $x + $r * cos($ang);
$y1 = $y + $r * sin($ang);

ImageLine($img, $x, $y, $x1, $y1, $col);
}

dl('php3_gd.dll');
// Win32 users should replace prev line with dl('php3_gd.dll');

// specify coords for the origins of the hands
// depends of the picture used as a background - draw your own !
$centrx = 29;
$centry = 29;

// depends on the background picture too.
$rmin = 22 ; // radius for minutes hand
$rhour = 12; // radius for hours        hand

//
// ^ -Pi/2 rad => 0 min
// |
// |
// |
// |
// --------> O rad => 15 min
//

$minrad = -1 * (pi()/2) ; // origin is -PI/2
$hourrad = -1 * (pi()/2) ; // same as above.

// Calculate the angles for drawing the hands
$hour = (date("h")/12)*2*pi() - (pi()/2);
$min = (date("i")/60)*2*pi() - (pi()/2);

// Output the HTTP header Content-type        
Header('Content-type: image/gif');

// specify path to background image file
$mypath = '/home/clauer/php3sampl/images/';

// Load watch background picture from file
$im = ImageCreateFromGIF($mypath.'watchframe.gif');

// Use pseudo "phosphore" light green for both hands
$mycolor = ImageColorAllocate($im, 153, 255, 204);

// Draw the hours and minutes hands
draw_radius($im, $centrx, $centry, $rmin, $min, $mycolor);
draw_radius($im, $centrx, $centry, $rhour, $hour, $mycolor);

// Send GIF output to client
ImageGif($im);
ImageDestroy($im);
?>



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
PHP Round Clock - Must have Gif support to use this.
Categories : PHP, Date Time, Graphics
Query Timer
Categories : PHP, Databases, Date Time
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
a simple pie-chart in php3 (with gd)
Categories : PHP, Graphics, GD image library, Charts and Graphs
mysql date/time converters
Categories : PHP, MySQL, Databases, Date Time
Checks Date-Input from HTML-Forms and converts to YYYY-MM-DD Format for MySQL Date-Fields
Categories : MySQL, Date Time, PHP, Databases
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Line graphics generation library written in PHP + GD library (spanish comments)
Categories : PHP, Graphics, GD image library
Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides
table calendar pretty much does what cal(1) does - prints out a calendar.
Categories : Date Time, PHP, Calendar
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
Simple image counter
Categories : PHP, Graphics, Filesystem, Beginner Guides
This is a simple photo gallery that reads the image files from multiple directories, and generates a web page styled with CSS1. It opens single auto window to view and print a given image.
Categories : Graphics, Filesystem, PHP, Complete Programs
This program implements hot link prevention in php. It is useful for webmasters who do not have access to the server at a level where they can control hot linking can still supply some type of hot link prevention for thier site by using php.
Categories : PHP, Filesystem, Graphics, Content Management
 Christophe LAUER wrote :527
Hi all,

My e-mail address is now clauer@free.fr

Regards,
CL