Ik gebruik het volgende PHP script (niet zelf geschreven) om een dynamische signature image aan te maken
Ik wil de uitvoer nu naar een ander bestand wegschrijven zodat ik dit script 1x per dag kan schedulen. Het hoeft dan niet steeds uitgevoerd te worden (ik tel toch alleen maar de dagen).
Wie weet hoe dit met behulp van GD werkt?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| <? $month = 4; // Month of the countdown $day = 3; // Day of the countdown $year = 2005; // Year of the countdown // mktime is the marked time, and time() is the current time. $target = mktime(0,0,0,$month,$day,$year); $diff = $target - time(); $days = ($diff - ($diff % 86400)) / 86400; $diff = $diff - ($days * 86400); $hours = ($diff - ($diff % 3600)) / 3600; $diff = $diff - ($hours * 3600); $minutes = ($diff - ($diff % 60)) / 60; $diff = $diff - ($minutes * 60); $seconds = ($diff - ($diff % 1)) / 1; header ("Content-type: image/png"); $imgname = "cal2005.gif"; $im = @imagecreatefromgif ($imgname); //Here are some common color codes in case you want to change the colors. //$white = imagecolorallocate ($im, 255, 255, 255); //$blue = imagecolorallocate ($im, 0, 0, 255); //$black = imagecolorallocate ($im,0,0,0); //$gray = imagecolorallocate ($im,153,153,153); //$red = imagecolorallocate ($im,255,0,0); //$orange = imagecolorallocate ($im, 255, 127, 36); $background_color = imagecolorallocate ($im, 0, 0, 0); $orange = imagecolorallocate ($im, 255, 127, 36); $yellow = imagecolorallocate ($im, 247, 246, 201); imagestring ($im, 3, 75, 35, "[ nog $days dag(en) ] ", $orange); imagegif ($im); imagedestroy ($im); ?> |
Ik wil de uitvoer nu naar een ander bestand wegschrijven zodat ik dit script 1x per dag kan schedulen. Het hoeft dan niet steeds uitgevoerd te worden (ik tel toch alleen maar de dagen).
Wie weet hoe dit met behulp van GD werkt?