Marc,
Your problem is in your echo statement. You are delimiting the echo with the single quote ('), and you are also using single quotes in your javascript. That won't work. I recommend you use heredoc, or take all of the javascript out of the PHP code as dnast has suggested. However, I wouldn't use the shortcut syntax -- there's a good chance your server has shortcut tags disabled. So, simply use <?php echo $menuhtml; ?>.
If you want to use heredoc syntax, here is your code rewritten. I have tested on my server, and it does work (although in my case the menuxURL and menuxLINK variables are empty, and there is a Javascript error that might be due to incomplete code). The menuhtml() function DOES return the intended HTML:
<?php
function menuhtml() {
$retval = <<<EOS
|
<a href="$menu0URL">$menu0LINK</a> |
<a href="$menu1URL">$menu1LINK</a> |
<a href="$menu2URL">$menu2LINK</a> |
<a href="$menu3URL">$menu3LINK</a> |
<a href="$menu4URL">$menu4LINK</a> |
<a href="$menu5URL">$menu5LINK</a> |
<a href="$menu6URL">$menu6LINK</a> |
EOS;
return $retval;
}
$menuhtml = menuhtml();
$menuhtml = str_replace('|','<br>',$menuhtml);
$phpself = $_SERVER['PHP_SELF'];
echo <<<EOS
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
if (!useRedirect) { // if dynamic embedding is turned on
if(hasRightVersion) { // if we detected an acceptable version
var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="339" height="284">'
+ ' <param name="movie" value="menu.swf?phpself=$phpself&b=$b">'
+ ' <param name="quality" value="high">'
+ ' <embed src="menu.swf?phpself=$phpself&b=$b" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="339" height="284"><\/embed>'
+ '<\/object>';
document.write(oeTags); // embed the flash movie
} else { // flash is too old or we cannot detect the plugin
// NOTE: height, width are required!
var alternateContent = '<table width="339" height="284" border="0" cellpadding="0" cellspacing="0"><tr><td><font size="2"><b><divalign="right">$menuhtml</div></font></b></td></tr></table>';
document.write(alternateContent); // insert non-flash content
}
}
// -->
</SCRIPT>
EOS;
?>