Hi, I have created an HTML test page and 7 includes files as directed using a script that i found at dynamic drive and that works fine on random but when I added the code to header.php and the then the call code to my mainpage.php page nothing appears, I have asked at dynamic drive but I have not been able to get the solution there and so any help is very appreiated.

1) Ajax Rotating Includes Script

2) http://www.dynamicdrive.com/dynamici...ajaxrotate.htm



heres what I have done so far -

Header


<base href="http://www.pinkspiderdirect.com/slow/">
<link rel="stylesheet" type="text/css" href="templates/Pixame_v1/stylesheet.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<!-- warnings //-->
<!-- warning_eof //-->
<!-- header //-->
<link rel="stylesheet" type="text/css" href="templates/Pixame_v1/stylesheet.css">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<script type="text/javascript">

/***********************************************


Ajax Rotating Includes script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
This notice MUST stay intact for legal use
Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//To include a page, invoke ajaxinclude(files_array, "ROTATETYPE") in the BODY of page.
//* file_array is the name of the array containing your list of files to include.
//* For "ROTATETYPE", valid values are "dailyw", "dailym", and "random", for each day of the week, each day of the month, and random, respectively.
//* Included file MUST be from the same domain as the page displaying it.

//Enter path to list of files to display.
//For rotatetype="dailyw", there must be 7 files, and for "dailym", 31 files. Otherwise, no restriction:

var includefiles=

var rootdomain="http://www.pinkspiderdirect.com"+window.location.hostname

function ajaxinclude(files_array, rotatetype){
includefiles=files_array
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var url=choosefile(files_array, rotatetype)
if (typeof files_array[url]=="undefined"){
document.write("Error: No file for this day has been found.")
return
}
else
url=files_array[url]
page_request.open('GET', url, false) //get page synchronously
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}

function choosefile(files_array, rotatetype){
var today=new Date()
var selectedfile=(rotatetype=="dailyw")? today.getDay() : rotatetype=="dailym"? today.getDate() : Math.floor(Math.random()*files_array.length)
if (rotatetype=="dailyw" && selectedfile==0) //if display type=="week days" and today is Sunday
selectedfile=7
if (rotatetype=="dailyw" || rotatetype=="dailym")
selectedfile-- //remove 1 to sync with array index
return selectedfile
}

</script>
lt;-----mainpage code-------------------------------------------------------------------------------->

<code>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body topmargin="0">




<table width="100%" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td height="37" colspan="2" align="center" valign="middle"><HR SIZE=4 color="#990000" ></td>
</tr>
<tr>
<td width="47%" height="162" align="center" valign="top">

<table width="264" height="430" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">

<script type="text/javascript">
ajaxinclude(includefiles, "random")
</script></td>
</tr>
</table>

ajax content should be above here

</td>
<td width="53%" rowspan="3" align="left" valign="top">

<!-- featured_products_mainpage //-->
<!-- featured_products_eof //-->

</td>
</tr>
<tr>
<td align="center" valign="middle"> </td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td height="41" align="center"> </td>
<td align="left" valign="top">
</td>
</tr>
</table>




<code>

Many Thanks

Patrick