deansaddigh Posted December 2, 2009 Share Posted December 2, 2009 OK so firstly heres the picture so you can see what it looks like. obvioulsy i want them next to each other with the name above the image and the price underneath the image. for each product. Heres my code <?php echo'<ol>'?> <!-- Make the product name clickable and pass through its id --> <?php echo '<li class="newproducts"><a href="product_details.php?productid='.$productid.'">' .$productname.'</a></li>';?> <?php echo '<li class="newproducts">' .$row ['ProductPrice'].'</li>';?> <?php echo '<li class="newproducts"><a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/></li>';?> <?php '</li>'?> <?php '</ol>'?> And here is my css .newproducts { float:left; } Any help would be fantastic Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 you would put them all in the same li but either use paragraph tags, linebreak tabs or styled ordered lists to display them as you want. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted December 2, 2009 Author Share Posted December 2, 2009 Firstly thanks very much for helping me. How would i put the following code in on <li> <?php echo'<ol>'?> <!-- Make the product name clickable and pass through its id --> <?php echo '<li class="newproducts"><a href="product_details.php?productid='.$productid.'">' .$productname.'</a><<br />';?> <?php echo '<li class="newproducts"><a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/></li><br /><br />';?> <?php echo '<li class="newproducts">' .$row ['ProductPrice'].'</li><br />';?> <?php '</li>'?> <?php '</ol>'?> Could you possible write it for me if its not to much trouble Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted December 2, 2009 Share Posted December 2, 2009 i havent tested this, mainly because i cant but also because i beleive you could figure out simple errors yourself, looking at the code you posted that should produce parse errors but what the hey. <ol> <!-- Make the product name clickable and pass through its id --> <li class="newproducts"> <a href="product_details.php?productid="<?php echo($productid); ?>"><?php echo($productname); ?></a><br> <a href="<?php echo($file); ?>" target="_blank"rel="lightbox"><img src="<?php echo($file); ?>" width="100" height="100"/></a><br> <?php echo($row ['ProductPrice']); ?> </li> </ol> p.s. I edited it a few times, try that but you cant just come and ask every single time one little thing doesnt work. Quote Link to comment Share on other sites More sharing options...
haku Posted December 3, 2009 Share Posted December 3, 2009 Please don't post PHP in the HTML/CSS section. Post the output of your script, not the script itself. Quote Link to comment 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.