No Image - No Show?

Posted on Monday 4th June 2007 at 08:18 PM
Diablosblizz
Diablosblizz's Avatar
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
SkillMaster's Avatar
Erm..

PHP Code
  1. $filename = '/url/to/images/$logged[username].gif';
  2.  
  3. if (file_exists($filename)) {
  4. echo "The file $filename exists";
  5. } else {
  6. echo "The file $filename does not exist";
  7. }

This is not mine but i found it on the web.
But it should work.
Login or register to respond to this forum topic.