Jump to content

Help With The Onmouseover And Countdown Timer


tifatima

Recommended Posts

Please help me with my script. In another forum, I have read that it is impossible to have Javascript work in a PHP loop. What i wanted to do is to select only the products that has the status of live and output it in my webpage. The thing is, it outputs the values I retrieved from the database but the countdown timer only works in one product. Another problem of mine is that the onmouseover doesn't work at all. Please help me on how to solve those problems. Thank you!

 

[/font]
[font=Verdana, sans-serif]<?php
$howmany = mysql_query("SELECT * FROM product WHERE status = 'LIVE'");
$nrow = mysql_num_rows($howmany);
for($i = 0; $i < $nrow; $i++){
$row = mysql_fetch_array($howmany);
$pname = $row[1];
$closedate = $row[4];
$img = $row[10];
?>

<td align='center'>
<table background="images/auctionbox.gif" width="170" height="330">
<tr>
 <td align="center"><?php echo $pname; ?></td>
</tr>
<tr>
 <td height="50px" align="center" width="50px"><img src="<?php echo $img; ?>"></td>
</tr>
<tr>
 <td align="center">
 <script language="Javascript">
 TargetDate = "<?php echo $closedate ?>";
 CountActive = true;
 CountStepper = -1;
 LeadingZero = true;
 DisplayFormat = "%%D%%d %%H%%:%%M%%:%%S%%";
 FinishMessage = "CLOSED!";
 </script>
 <script language="Javascript" src="includes/countdown.js"></script>
 </td>
</tr>
<tr>
 <td align="center">P<label id="this">1.00</td>
</tr>
<tr>
 <td align="center">Last Bidder</td>
</tr>
<tr>
 <td align="center">
 <script type="Javascript" src="includes/idkthis.js"></script>
 <a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('BidButton','','images/bid-login.gif',1)" href="login">
 <img name="BidButton" onload="MM_preloadImages('images/bid-login.gif')" width="90" height="40" src="images/bid-bid.gif"></a>
 </td>
</tr>
</table>
</td>
<?php
}
?>
Edited by tifatima
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.