Jump to content

[SOLVED] Variable problem inbetween single quotes


hiveman

Recommended Posts

I am using a script that shows and hids a div.  The script works great if I write the name of the div in between single quotes. :)  Example:

 

      <input type="image" onClick="toggleBox('name_of_div',1);" value="Show Div" src="images/bookcoversmall.gif" width="137" height="200" />

 

I am trying to use the same script in a php code for a store.  I want to have a list of thumbnails of the products generated on the page and when they mouseover the thumbnail it shows a div which contains details about the product.  I am able to generate a specific div name for each product using a Variable ( $Name ) which calls up the name of the product and collapsing any spaces in the name and attaching _thumbnailzoom.  So if the product name is Honey Bear it would generate a div id of HoneyBear_thumbnailzoom.  I need to generate the exact same word inbetween the singlequotes in the above code for the name of the div.  So the generated code should output the following:

 

    <input type="image" onClick="toggleBox('HoneyBear_thumbnailzoom',1);" value="Show Div" src="images/bookcoversmall.gif" width="137" height="200" />

 

 

This is the code I am currently using:

 

<?php

     

              $array = array($Name, '_thumbnail_zoom');

              $comma_separated = implode("", $array);

 

        ?>

     

     

      <input type="image" onmouseover="toggleBox('$comma_separated',1);" value="Show Div" onmouseout="toggleBox('$comma_separated',0);" value="Hide Div" src="<?=$Thumbnail_Image?>" border="0" width="<?=$Thumbnail_Image_Width?>" height="<?=$Thumbnail_Image_Height?>" alt="<?=$Name?>" /></a></a>

 

 

:'(Unfortunately its not working for me.  I've tried removing the single quotes and its not working either.  Help from someone who knows what they are doing would be greatly appreciated. 

 

  - signed Honeyman

       

 

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.