Jump to content

image gallery


sooty2006

Recommended Posts

hi,i am making an image gallery for my site and every 3 images i want to make a new line so i dont have a long line of images i have tried everything i know!but i know you can do it using the count function!but i am unsure how to use it properly could anyone give me any tips or show me how to do it?i will be very greatfull! :)scott

Link to comment
Share on other sites

<?php  $images=array('blah.jpg', 'one.gif', 'something.jpg', ...list keep on going); // Or however you get the names of the files  for($i=0; $i<count($images); $i++) {	echo '<img src="'.$images[$i].'">';	if($i%3==2) {	  echo '<br>';	}  }?>

Link to comment
Share on other sites

erm sorry i tryed it changing the imagesbut now theres another problem!heres my script:

<?phpif ($_GET['show_page']) {$get_tot = $_GET['show_page'];$query42 = mysql_query("SELECT * FROM image_gallery ORDER BY id DESC LIMIT $get_tot , 12");}else{$query42 = mysql_query("SELECT * FROM image_gallery ORDER BY id DESC LIMIT 0 , 12");}$rows42 = mysql_num_rows($query42);$i = 0;while($i <= $rows42) {$array = mysql_fetch_array($query42);echo "<img src=\"handle_image.php?w=90&h=90ℑ=$array[image_link]\">";if($i%3 == 2) {echo "<br>";}$i ++;}?>

it makes a new line for every 3 images like it should do but...it makes an image not in the directory i have checked everything!visit http://www.gcjconstruction.co.uk/index.phpand visit image gallery you will see what i meanwhy is it doing that please help me!thanks! :)

Link to comment
Share on other sites

thanks never even thought of that! :)who knew something so simple could be such a problem lol! thanks alot, justsome guy u saved me again! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...