Chris |
03-08-2004 04:20 AM |
php question
here is the source for the thing in my sig
PHP Code:
$current="";
$started="";
$l=@fopen("sig.php",r);
$self=@fread($l,filesize("sig.php"));
@fclose($l);
if($self){
$l=time()-2629743;
if(!$current>0 || !$started || $started<$l){
$self=str_replace("started=\"$started\"","started=\"".time()."\"",$self);
$self=str_replace("current=\"$current\"","current=\"1\"",$self);
$current=1;
$started=time();
}else{
$self=str_replace("current=\"$current\"","current=\"".($current+1)."\"",$self);
$current=$current+1;
}
$l=@fopen("sig.php",w);
@fputs($l,$self);
@fclose($l);
}
Header("Content-type: image/jpeg");
$image=imagecreate(250,22);
$white=ImageColorAllocate($image,255,255,255);
$black=ImageColorAllocate($image,0,0,0);
$red=ImageColorAllocate($image,255,0,0);
ImageFilledRectangle($image,0,0,250,22,$white);
ImageRectangle($image,0,0,249,21,$black);
$string="Sig viewed $current times since ".date("M d. H:i",($started-24*3600))."";
ImageString($image,1,2,1,$string,$red);
ImageString($image,1,65,11,'Icq - 71462500. I want an Xbox!',$black);
ImageJPEG($image);
ImageDestroy($image);
now i was wonderin if i could spruse it up a bit and make it say how many clicks i have had or could i make another button to say how many clicks i have gotten
|