euel Posted December 2, 2011 Share Posted December 2, 2011 Elo, I'm creating a very simple image list that is function generated which pulls the source from a table in my database, this is my code $output = "<ul>"; $img_src = get_all_image_src($sel_event['id']); while($src = mysql_fetch_array($img_src)) { for($i=0;$i <= 9; $i++) { $output .= "<li>"; $output .= "<a"; $output .= " class ='album'"; $output .= " rel='group'"; $output .= " href='/images/gallery/'" . $src['img_src'] . $i; $output .= ".jpg"; $output .= " title='sample 1'"; $output .= ">"; //Image Thumb $output .= "<img"; $output .= " src='/images/gallery/'"; $output .= $src['img_thumb_src']. $i . ".jpg"; $output .= "alt='image01' "; $output .= "title='sample title' />"; $output .= "tae"; $output .= "</a>"; $output .= "</li>"; } } $output .= "</ul>"; return $output; and the img src doesnt seems to add up... my folder structure is Sandbox>image>gallery>2011>Mall>Event>Thumbs where Sandbox is the main directory. i tried echoing the $src['img_src'] and it displays correctly the data to be added (which is 2011/Mall/Event/ plus $i and a .jpg) .. sorry noob here... any thoughts? am i missing a simple detail? Link to comment https://forums.phpfreaks.com/topic/252285-img-src-problem/ Share on other sites More sharing options...
euel Posted December 2, 2011 Author Share Posted December 2, 2011 After a coke float and large fries i solved my stupid problem... hehehehe. It seems the src doesn't want to be concatenated so i replaced this $output .= "<a"; $output .= " class ='album'"; $output .= " rel='group'"; $output .= " href='/images/gallery/'" . $src['img_src'] . $i; $output .= ".jpg"; with this $output .= "<a"; $output .= " class ='album'"; $output .= " rel='group'"; $output .= " href='images/gallery/{$added}.jpg'"; $output .= " title='sample 1'"; $output .= ">"; where $added is the string verison of $src['img_src'] . $i... im so dumb.. thannnks anyways!!!! Link to comment https://forums.phpfreaks.com/topic/252285-img-src-problem/#findComment-1293389 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.