Help please! having some relative positioning trouble.

Phreaddee

Super Moderator
Staff member
sits at the bottom for me.

its probably got something to do with nested div issues (you do have one div closing AFTER the body tag) of which you have several too many.

simplify.
 

JakClark

New Member
Did you rectify the issue? I don't see the problem you specified but it'd be good to give the footer a position:fixed and let other content scroll.
 

cjamesblanton

New Member
I've sort of fixed the problem that I mentioned in my first post... For now at least. Thanks for the help.

Ive run in to an other problem now. I'm trying to use php to create an image gallery. I want to define an array with images, then have a loop display those images in div areas until the loop reaches the end of the array. Hopefully that makes sense...

I'm not very experienced with web design, if you can't already tell.

What's wrong with this code?

Code:
<?php
$my_images = array (
  'image1' => "http://www.webdesignforum.com/images/image1.jpg",
  'image2' => "http://www.webdesignforum.com/images/image2.jpg",
);

$total = count($my_images);
while ($total > current($my_images)) {

        echo "<div class='box'>";
		
			 echo '<a href=""><img src="' . $my_images . '" /></a>'; 
			  
			echo "</div>";
    
    next($my_images);
}
?>

This code is currently an infinite loop. It's creating the div areas, but not filling the div's with the images in the array. My guess is that it's not counting the positions in the array correctly?
 
Last edited:

cjamesblanton

New Member
I fixed the image gallery codes... note that the forum is adding http://www.webdesignforum.com/ to any place that I put a images/ location.

Code:
EDIT: Yeees! I fixed the php all on my own! Here's how it should have been:
<?php
 //a list of support file types to allow in the gallery
 $allowed_filetypes = array('.jpg','.gif','.png','.bmp'); 
                    
//$path_thumnails represents the location of the thumbnails to show in gallery
$path_thumnails = opendir("http://www.webdesignforum.com/images/"); 

function testFUNC (){
$my_images = array ("http://www.webdesignforum.com/images/image1.jpg", "http://www.webdesignforum.com/images/image2.jpg", "http://www.webdesignforum.com/images/image3.jpg");

$currents = current($my_images);
$totals = count($my_images);
$i=0;
while ($i< $totals) {
        echo "<div class='box'>";
		
			 echo '<img src="'.$my_images[$i].'" /></img>';
			  
			echo '</div>';
    
    $i++;
}
}

testFUNC();

?>
 
Top