I try it using your method. It's not availability.
Can you tell me detailedly how to do it? Thanks!
The follow is the code:
<?Header( "Content-type: image/jpeg"); ?>
<html>
<head>
<title>ÈÕÀú</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
$im = ImageCreate(156, 142);
$black = ImageColorAllocate($im, 50, 50, 100);
$white = ImageColorAllocate($im, 255, 255, 255);
$orange = ImageColorAllocate($im, 255, 200, 0);
$yellow = ImageColorAllocate($im, 255, 255, 0);
$tan = ImageColorAllocate($im, 255, 255, 190);
$grey = ImageColorAllocate($im, 205, 205, 205);
$dkgrey = ImageColorAllocate($im, 140, 140, 140);
###»ÒÏß ###
#±ß¿òÏß
ImageRectangle($im, 1, 1, 155, 141, $dkgrey);
#ˮƽÏß
ImageRectangle($im, 1, 22, 155, 39, $dkgrey);
ImageRectangle($im, 1, 56, 155, 73, $dkgrey);
ImageRectangle($im, 1, 90, 155, 107, $dkgrey);
ImageRectangle($im, 1, 107, 155, 124, $dkgrey);
#´¹Ö±Ïß
ImageRectangle($im, 23, 22, 45, 141, $dkgrey);
ImageRectangle($im, 67, 22, 89, 141, $dkgrey);
ImageRectangle($im, 111, 22, 133, 141, $dkgrey);
°×Ïß
#Íâ¿òÏß
ImageRectangle($im, 0, 0, 154, 140, $white);
#ˮƽÏß
ImageRectangle($im, 0, 21, 154, 38, $white);
ImageRectangle($im, 0, 55, 154, 72, $white);
ImageRectangle($im, 0, 89, 154, 106, $white);
ImageRectangle($im, 0, 106, 154, 123, $white);
#´¹Ö±Ïß
ImageRectangle($im, 22, 21, 44, 140, $white);
ImageRectangle($im, 66, 21, 88, 140, $white);
ImageRectangle($im, 110, 21, 132, 140, $white);
ÔÚÉÏÃæÐ´Êý×Ö
$today = date( "d");
$month = date( "m");
$year = date( "Y");
$datecode = date( "Ymd");
$jpeg = '.jpeg';
$first=mktime(0,0,0,$month,1,$year);
$mon_yr=date( "F Y", $first);
$wd=date( "w",$first);
#if ($wd==0) { $wd=7;}
$lastday=date( "d",mktime(0,0,0,$month+1,0,$year));
$cur=-$wd+0;
$ver_position = 50;
for ($k=0;$k<6;$k++) {
$day_position = 5;
$last_row_used = 0;
for ($i=0;$i<7;$i++ ) {
$cur++;
$sing_add = 0;
if (($cur<=0) || ($cur>$lastday) ) $day_position = ($day_position + 22);
else
{
$day_color = $grey;
if ($day_position<10) $day_color = $tan;
if ($cur==$today) $day_color = $yellow;
if (strlen($cur)<2) {$sing_add = 4;}
$fin_position = ($day_position + $sing_add);
ImageTTFText($im, 12, 0, $fin_position, $ver_position, $day_color, "c:\winnt\fonts\arialbd.ttf", "$cur");
$day_position = ($day_position + 22);
$last_row_used = 1;
}
}
$day_position = 5;
if ($last_row_used) $ver_position = ($ver_position + 17);
}
Ô·ݺÍÄê·Ý £¨Arial×ÖÌå¡¢¼Ó´Ö¡¢¾ÓÖУ©
$spc = 23;
$st_add = 0;
$st = "$mon_yr";
$st_len = strlen($st);
$st_margin = (14 - $st_len);
if ($st_margin > 0) {$st_add = ($st_margin * 4);}
$spc = ($spc + $st_add);
ImageTTFText($im, 14, 0, $spc, 15, $white, "c:\winnt\fonts\arialbd.ttf", "$st");
ÐÇÆÚµÄÃû×Ö
ImageString($im, 2, 3, 23, "Sun", $orange);
ImageString($im, 2, 25, 23, "Mon", $orange);
ImageString($im, 2, 47, 23, "Tue", $orange);
ImageString($im, 2, 69, 23, "Wed", $orange);
ImageString($im, 2, 91, 23, "Thu", $orange);
ImageString($im, 2, 113, 23, "Fri", $orange);
ImageString($im, 2, 135, 23, "Sat", $orange);
if ($ver_position<140)
{
$im_out = ImageCreate(156, 125);
$out_black = ImageColorAllocate($im_out, 50, 50, 50);
ImageRectangle($im, 1, 124, 155, 124, $dkgrey);
ImageCopyResized($im_out, $im, 0, 0, 0, 0, 156, 125, 156, 125);
ImageInterlace($im_out, $out_black);
ImageJpeg($im_out, "calendar$jpeg");
ImageJpeg($im_out);
ImageDestroy($im);
ImageDestroy($im_out);
}
else
{
ImageInterlace($im, $black);
ImageJpeg($im, "calendar$jpeg");
ImageJpeg($im);
ImageDestroy($im);
}
header("Location: <a href="http://" target="_blank">[url]http://[/url]</a>".$HTTP_SERVER_VARS['HTTP_HOST']."myhomepage.php");
?>
</body>
</html>