include '../../snippets/connect.php'; 

$orgid = $_GET['orgid'];

if(!isset($orgid) || empty($orgid)){

     die("Please select your image!");


$query = mysql_query("SELECT orghomepic FROM org_home_pic WHERE orgid='".$orgid."'");
$row = mysql_fetch_array($query);
$content = $row['orghomepic'];

   if (empty($content)) {
        **$image  = imagecreatefromjpeg('');  

      header('Content-type: image/jpg');

       } else {

       header('Content-type: image/jpg');
       echo $content;


So this was working previously and upto maybe 1 week ago it was not working, was wondering if anyone had any suggestions at all as to why it isn't/stopped working... or what i could fundamentally change to get the required result...

Which is if the image in teh database exists use it(this bit works fine)... if it doesnt exist display default (the bold bit - Doesnt Work)

The url is requesting for user and password, if this is not your domain maybe it's a counter measure for hotlinking issues. If it's yours domain then just use server path, for example:

$image  = imagecreatefromjpeg('/var/www/dev/media/images/nohomepic.jpg'); 

And now it is obvious that this stopped working when i added authentications to my site for the development stage, thank you cereal thread solved.. 1 shot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.