Hi everyone.
So I have a shopping cart which has a product details.
The thing is, the photo is taken from the database but it is just a plain photo.
I want to make it more pretty, so I want to add the prettyphoto script to it.
Basically I have this code now:

<table width="100%" border="0" cellspacing="0" cellpadding="10">
 <th> 
  <td align="center"><img src="<?php echo $pd_image; ?>" border="3" alt="<?php echo $pd_name; ?>"></td>
  <td valign="middle">
 <strong><?php echo $pd_name; ?></strong><br>
 Price: <?php echo displayAmount($pd_price); ?><br>

And to the picture I like to add the PrettyPhoto script, which is something like this:

<div class="portfolioItem3"> <a class="threeColumnsImage" href="./images/portfolio/threeColumnsL1.jpg" rel="prettyPhoto" title="Lorem ipsum dolor sit amet"><img src="./images/portfolio/threeColumns1.jpg" alt="" /></a>

The thing is, it works in a way, but after I click on the image, it starts to load and it says:

The image cannot be loaded. Make sure the path is correct and the image exists.

So I think that that's something to do with the href="" in the prettyPhoto script. But since I take the pictures from the database, how can I do this to work?

Thanks!

Recommended Answers

All 2 Replies

Member Avatar for diafol
<td class="portfolioItem3"> <a class="threeColumnsImage" href="./images/portfolio/threeColumnsL1.jpg" rel="prettyPhoto" title="Lorem ipsum dolor sit amet"><img src="./images/portfolio/threeColumns1.jpg" alt="" /></a></td>

Is that what you're looking for?

You're mixing html attributes and class for CSS. Get rid of all the html attributes and describe them in CSS.

So is this what you want at the end?

<td class="portfolioItem3">
<a class="threeColumnsImage" href="<?php echo $pd_image; ?>" rel="prettyPhoto" title="<?php echo $pd_name;?>">
<img src="<?php echo $pd_image; ?>" border="3" alt="<?php echo $pd_name; ?>">
</a>
</td>

It worked like a charm!!!
Thank you so much!!!:-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.