I have trying to embed JavaScript in my php pages. I have a product.php page which has product info and the product thumbnail image. I would like to include a JS script, so that when a user click on the thumbnail and new page appears with the bigger image.
Can someone help me with this. I have never done JS before, but it would be nice if someone can guide me to the right path or maybe show me some part of a code to help me with this.
So far, I have the product.php and backend is mysql. So maybe JS page should dynamically go to the database to get that image for that particular click...
My product.php has this line, which tries to open the JS page but when i click on the image it does not do anything.
Code: Select all
echo '<a href="javascript:;" onClick="MM_openBrWindow("imagePage.php", "", width=""'.$rowї'itemWidthLarge']."" height="" .$rowї'itemHeight']. "">" ;Code: Select all
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<?php
if($result = mysql_query("SELECT * FROM $table WHERE catID=6")){
while( $row = mysql_fetch_array($result)){
echo '<p align="center">';
echo "<img src ="/images/products/royal/" . $rowї'itemURL'] .".jpg" width="" .$rowї'itemWidthLarge']. "" height="".$rowї'itemHeightLarge']."" align="middle">";;
?>
</td>
</tr>
<tr>
<td colspan="2">
<?php
echo '<strong><em><font color="#0066FF" size="4" face="Arial, Helvetica, sans-serif">';
echo $rowї'itemName'] .'<br></strong></font></em>';
?>
</td>
</tr>