Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 106
0 Users 2 Guests Online
Forum Index » PHP + MySQL » No Image - No Show?
Posted on Monday 4th June 2007 at 08:18 PM
Diablosblizz
templates/default/images/noavatar.png's Avatar
Senior Member
Hey, I was wondering if there was a script to check if there was a image under the name of the username of the profile that the person was viewing.

Example:

Because my username is Diablosblizz, the image would be called diablosblizz.gif

If there was no image then a text would show saying
"No Image!"

Is this possible? Thanks!
Posted on Monday 4th June 2007 at 08:41 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
Erm..

PHP Code
1
2
3
4
5
6
7
8
$filename = '/url/to/images/$logged[username].gif';

if (file_exists($filename)) {
    echo "The file $filename exists";
} else {
    echo "The file $filename does not exist";
}

This is not mine but i found it on the web.
But it should work.