Jump to content

Doing a Rollover Image in PHP


suess0r

Recommended Posts

Hi there,

 

I basically want to use a GET to find out which Template my customer has chosen and basically make a rollover from the Template Images they chose. The $id is the same name as the image, and $id-over.gif is the rollover image... Here's what i got

 

<?php

$id = $_GET["id"];

echo '<a href="http://www.google.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage("Image126","","images/FlashdesignTemplates/Big/'.$id.'-over.gif",1)"><img src="images/FlashdesignTemplates/Big/'.$id.'.gif" name="Image126" width="329" height="326" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage("Flash","","images/FlashdesignTemplates/Big/'.$id.'-over.gif",1)"></a></td>';

 

?>

 

I'm getting a display of the Original image but it's not doing the Rollover (i would assume because i'm no longer in the PHP when the user runs the mouseover) but could use a lil help, thanks!

Link to comment
https://forums.phpfreaks.com/topic/44443-doing-a-rollover-image-in-php/
Share on other sites

here is the code fixed up.

<?php
$id = $_GET['id'];
echo "<img src=\"images/FlashdesignTemplates/Big/{$id}.gif\" name=\"Image126\" width=\"329\" height=\"326\" border=\"0\"><a href=\"#\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Flash','','images/FlashdesignTemplates/Big/{$id}-over.gif',1)\"></a></td>";
?>

 

but tell me, should the image be between the <a> tag?

Hi,

 

The rollovers still not working, the image shows up fine but again the mouseover isn't doing anything. It does have to be in between the <a> tag b/c each different template needs to link to a site preview aka /Template/Preview/$id.html. I'd really like to get this to work but I dunno why the rollover still doesn't work? Anyone have any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.