Page 1 of 1

Combining php and javascript

Posted: Sun Nov 02, 2003 2:42 pm
by jensl1972
Hi all,

I'm trying to combine this php script:

<p><a href="<?php echo _URLFORLINK1; ?>" alt="<?php echo _ALTFORLINK1; ?>">
<?php $linky1 = _LINK1; if (file_exists($imgpath."1_link-".$language.".gif")) { $linky1 = "<img src=\"".$imgpath."1_link-".$language.".gif\" border=\"0\">"; } echo $linky1; ?></p>

with this javascript:

<a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','<?php echo $imgpath; ?>2_link-dan.gif',1)"><img src="<?php echo $imgpath; ?>1_link-dan.gif" name="Image41" width="81" height="27" border="0" id="Image41"></a>

The first changes image according to selected language and the secon is a normal mouse over img swap from DreamWeaver.

Any suggestions?

Posted: Sun Nov 02, 2003 6:54 pm
by m3mn0n
Echo the javascript+html and just add $variablename within the echo.

That usually works best.