Hey guys, i have a small problem. I have this flatfile counter script which prints out images according to the amount stored in a data.txt file (the number of hits) and im using ti in wml. It' works fine and all, but the <p align="center"> tag does not work the same as in html. If i view the counter in html, it prnts out like this:
eg (imagine the images):
12345
but, in wml it looks like this:
1
2
3
4
5
........
i need help in making the images it prints out into only one image, so that when i center it it will center just as if it were a word.
Here is the script:
<?
$data_file = './data.txt';
$images_dir = './images/';
function counter_block () {
global $data_file, $images_dir;
$fp = fopen("$data_file" , "r");
$count = (int)fread($fp, 1024);
$count++;
fclose($fp);
for ($i = 0 ;$i < strlen($count) ; $i++)
{
$imgsrc = substr($count,$i ,1);
print "<img src =\"$images_dir" . $imgsrc . ".gif\">";
}
$fp = fopen("$data_file", "w");
fwrite($fp, $count);
fclose($fp);
}
counter_block();
?>
Thanks in Advance!!
PS:
Here is a link to the working script:
http://wapbeta.johnex.se/counter.php