PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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>";
}
?>
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:
What is $source? (echo it)
The relative path may be wrong.. eg it is just coming up as /2329839832.png when it should be /uploads/rainbowcode/images/profilepics/2329839832.png
(i didn't use the actual numbers, lol)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
In your case you need imagecreatefrompng() for your png file. A better solution would be to read the file name (or even better the MIME type) and execute the correct code accordingly.