if (file_exists($filename)) issue
Posted: Mon Nov 08, 2010 2:26 am
please i need some help, i am new at php and dont understand the above.
my code is:
the file DOES exist but how come it executes the else? because when i refresh my web page the "You have not uploaded an image yet" wording displays
all my pics are in folder:
the pic in question is: 27824578364.png
please help
thanks
my code is:
Code: Select all
<?php
$filename = $usr_profile->getMsisdn().".png";
if (file_exists($filename))
{
$source = imagecreatefromjpeg($filename);
}
else
{
$filename = "Rainbow-code-1_blck.jpg";
$source = imagecreatefromjpeg($filename);
echo "<span class='spn_big_black_rbc'>You have not uploaded an image yet</span>";
}
?>
all my pics are in folder:
Code: Select all
~/traffic_2/phoenix/web/uploads/rainbowcode/images/profilepics$ ls
27823666789.png 27826597690-wap.jpg 27836001221.png 27836001238.pngjpg Rainbow-code-1.jpg
27824578364.png 27826597693.png 27836001224.png 27836001238.png-wap.jpg StickFig.jpg
27826117690.png 27832298298-wap.jpg 27836001238.png Rainbow-code-1_blck.jpg
please help
thanks