Re: php counter

From: Date: Tue, 06 Aug 2002 21:13:30 +0000
Subject: Re: php counter
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111436@lists.php.net to get a copy of this message
try this: $image_tag_str .="<IMG SRC=\"$image_src\" BORDER=\"0\">"; AR> Trying to test a counter using php / MS Windows 98 / Apache with three .jpg AR> files. AR> They are named: AR> 1.jpg AR> 2.jpg AR> 3.jpg AR> and are stored in a folder called: AR> images AR> which is in the same directory as Counter.txt AR> within AR> htdocs. AR> I run the following script but the images do not appear. AR> Thanking all in advance. AR> Tony Ritter AR> ............................................................ AR> <? AR> $counter_file="./Counter.txt"; AR> $image_dir="./images"; AR> if(!($fp=fopen($counter_file, "r")))die("Couldn't open the file"); AR> $counter=(int)fread($fp, 20); AR> fclose($fp); AR> $counter++; AR> for($i=0; $i<strlen($counter); $i++) AR> { AR> $image_scr=$image_dir."/".substr($counter, $i, 1).".jpg"; AR> $image_tag_str.="<IMG SCR=\"$image_src\" AR> BORDER=\"0\">"; AR> } AR> echo "You are visitor $image_tag_str"; AR> $fp=fopen($counter_file, "w"); AR> fwrite($fp,$counter); AR> fclose($fp); ?>>

« previous php.general (#111436) next »