Hi all. I'm trying to implement a rotating image system written in Javascript into a PHP website. The PHP page and the Javascript both work fine independently, but integrating the JS is proving tough and giving me errors.
Here is the top part of the PHP page:
<?
include ("./application.php");
include ("./functions.php");
include ("./database.php");
After line 4 I would like to implement the following Javascript:
<!--webbot bot="HTMLMarkup" startspan --><script language="JavaScript"><!--
//store the quotations in arrays
images = new Array(2);
images[0] = "<a href = 'http://www.niburu.nl/index.php?articleID=22481'><img src='http://www.niburu.nl/img/blooms2.jpg' border=0></a>";
images[1] = "<a href = 'http://www.flexwebhosting.nl/'><img src='http://www.niburu.nl/img/flexweb2.jpg' border=0></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
// --></script><!--webbot bot="HTMLMarkup" endspan --> <!--webbot bot="HTMLMarkup" startspan --><script language="JavaScript"><!--
//store the quotations in arrays
images = new Array(1);
images[0] = "<a href = 'http://www.niburu.nl/index.php?articleID=22449'><img src='http://www.niburu.nl/img/spieghel2.jpg' border=0></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
// --></script><!--webbot bot="HTMLMarkup" endspan --> <!--webbot bot="HTMLMarkup" startspan --><script language="JavaScript"><!--
//store the quotations in arrays
images = new Array(1);
images[0] = "<a href = 'http://www.niburu.nl/index.php?articleID=22551'><img src='http://www.niburu.nl/img/letsclean.jpg' border=0></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
// --></script><!--webbot bot="HTMLMarkup" endspan -->
Any ideas how I can get this to display properly? Simply pasting the JS isn't working, and I'm not too good at the whole coding thing. Thanks for any help, I really appreciate it.