I have a random image generator on my site. The images are randomized in random.php and then that page prints out a link that links to a pop-up javascript window.
The problem is that when the PHP prints the code, it's breaking it up after it prints the random image variables it created, causing an error in the javascript. The javascript still works, but error messages come up for those coming to the site.
I've posted the echo code below, as well as what results in the final page.
echo "<a href=\"java script:randWin('$directory_depth$random_image[1]')\" onclick=\"randWin('$directory_depth$random_image[1]');return false\"><img border=\"0\" src=\"$directory_depth$random_image[0]\"></a>";
(and it's one line in the file, the board just breaks it up here...)
Final result...
<a href="java script:randWin('pics/archive9/cwdata/a9p7.html
')" onclick="randWin('pics/archive9/cwdata/a9p7.html
');return false"><img border="0" src="randimg/71.gif">
How do I get it to print without line breaks?