Jump to content

img src problem?


euel

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.