|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in Mar 2007
36 posts
Gave thanks: 3
Thanked 0 times
|
PHP Counter Problem
I'm writing a simple counter program in php to include on my website. I threw this together real quick and the file handling works perfectly, but my images aren't displaying and I'm just not seeing why. I'm getting the dreaded white box with the red 'x' through it. The line of code on my main page is:
<?php include("/home/account/public_html/counter/counter.php"); ?> counter.php is as follows: <?php $fp = fopen("/home/account/public_html/counter/counter.txt" , "r"); $count = (int)fread($fp, 1024); $count++; fclose($fp); for ($i = 0 ;$i < strlen($count) ; $i++) { $imgsrc = substr($count,$i ,1); //display the image(s) echo "<img src =\"/home/account/public_html/counter/" . $imgsrc . ".GIF\">"; } $fp = fopen("/home/account/public_html/counter/counter.txt", "w"); fwrite($fp, $count); fclose($fp); ?> The images are 0.GIF, 1.GIF, etc. Can anyone see why these wouldn't be displaying? I just need another pair of eyes to look at it at this point. |
|
|
|
|
|
#2 (permalink) |
|
He shoots.. He scores!
Super #1
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,449 posts
Gave thanks: 46
Thanked 140 times
|
Can you call the images directly in your browser?
http://domain.com/counter/1.GIF ? Also, are your GIF extensions UPPER CASE , lower case or Mixed Case?
__________________
SH110
|
|
|
|
|
|
#3 (permalink) |
|
Registered User
Seasoned Poster
Joined in Mar 2007
36 posts
Gave thanks: 3
Thanked 0 times
|
I can access the images directly in my browser from http://domain.com/counter/1.GIF .
And my file extensions are all upper case such as .GIF |
|
|
|
|
|
#4 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,227 posts
Gave thanks: 18
Thanked 86 times
|
change
PHP Code:
PHP Code:
![]() Hope that helps.
__________________
|
|
|
|
| This user thanks MarkRH for this great post! | jacker (July 31st, 2007) |