hello all, i got this php code that displays information to rotate withour refreshing the page (thru ajax) my question is how can i make it pull the info from a database? right now is pulling from embeded html pages, below is the code
// an array of banners
$banners = array (
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="banner4newsite.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="banner4newsite.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
',
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="monday.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="monday.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
',
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="tuesday.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="tuesday.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>',
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="wednesday.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="wednesday.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
',
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="thursday.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="thursday.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
',
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>banner4newsite</title>
</head>
<body bgcolor="#000000">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="757" height="250" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="sundays.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="sundays.swf" quality="high" bgcolor="#000000" width="757" height="250" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>'
);
// pick a random one
$html = $banners[array_rand($banners)];
// send XML headers
header('Content-type: text/xml');
echo '<?xml version="1.0" ?>';
// print the XML response
<banner>
<content>
echo htmlentities($html);
</content>
<reload>10000</reload>
</banner>
thanks to all for the help in advance