mat3000000 Posted August 25, 2011 Share Posted August 25, 2011 Here is what is echoing the string "Resource id #1". However I do not know if it is the php or javascript that is outputting this. Can anyone tell me why this is showing and how to make it not show? PHP: $directory = "Images/items/$product/"; //get all image files with a .jpg extension. $images = glob($directory . "*.jpg"); $imgone = $images[0]; $gallery = '<tr><td valign="top" align="center">'; foreach($images as $image) { $tn = explode("/", $image); $tnname = $tn[3]; $gallery .= '<a href="#" rel="'.$image.'" class="image" alt="Images/items/'.$product.'/large/'.$tnname.'"><img src="Images/items/'.$product.'/thumbs/'.$tnname.'" class="thumb" border="1" style="margin-bottom:7px;"/></a> '; } if(is_dir("Images/items/".$product)) $gallery .= "</td></tr><tr><td width='300'>".$link."<div id='image' class='bigimg' align='left'>"; if(is_dir('Images/items/'.$product)) $gallery .= '<img src="'.$imgone.'" border="0"/></div></a></td></tr>'; JS (jQuery) $(function() { $(".image").click(function() { var image = $(this).attr("rel"); var large = $(this).attr("alt"); $('#image').hide(); $('#image').fadeIn('slow'); $('#image').html('<a href="' + large + '" ><img src="' + image + '"/></a>'); return false; }); }); Quote Link to comment https://forums.phpfreaks.com/topic/245676-hide-resource-id-1/ Share on other sites More sharing options...
trq Posted August 25, 2011 Share Posted August 25, 2011 This is cause by trying to echo a Resource in PHP (which is not possible). Where is $product defined? Quote Link to comment https://forums.phpfreaks.com/topic/245676-hide-resource-id-1/#findComment-1261803 Share on other sites More sharing options...
mat3000000 Posted August 25, 2011 Author Share Posted August 25, 2011 Product is retrieved from URL, but I was trying to echo $link in the php when it was not declared. Thanks for your help anyways. Quote Link to comment https://forums.phpfreaks.com/topic/245676-hide-resource-id-1/#findComment-1261807 Share on other sites More sharing options...
trq Posted August 25, 2011 Share Posted August 25, 2011 Product is retrieved from URL, but I was trying to echo $link in the php when it was not declared. Thanks for your help anyways. That would not produce your symtoms. Quote Link to comment https://forums.phpfreaks.com/topic/245676-hide-resource-id-1/#findComment-1261814 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.