<?php
$request = isset($_GET['request']) ? $_GET['request'] : '';
$test = isset($_GET['test']) ? $_GET['test'] : '';
if ($request == 'xml') {
header('Content-Type: text/xml');
// wait a little bit, just to simulate a slow connection.
sleep(1.5);
if ($test == 'test_empty') {
echo "<root></root>";
} elseif ($test == 'test_masterexample') {
echo "<root>\n";
echo " <image>\n";
echo " <title>Monkey</title>\n";
echo " <path>JaxSlideshow/image/web-1.gif</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>PHP</title>\n";
echo " <path>JaxSlideshow/image/web-2.gif</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>Ubuntu</title>\n";
echo " <path>JaxSlideshow/image/web-3.jpg</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>WDG</title>\n";
echo " <path>JaxSlideshow/image/web-4.gif</path>\n";
echo " </image>\n";
echo "</root>\n";
} else {
echo "<root>\n";
echo " <image>\n";
echo " <title>Monkey</title>\n";
echo " <path>image/web-1.gif</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>PHP</title>\n";
echo " <path>image/web-2.gif</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>Ubuntu</title>\n";
echo " <path>image/web-3.jpg</path>\n";
echo " </image>\n";
echo " <image>\n";
echo " <title>WDG</title>\n";
echo " <path>image/web-4.gif</path>\n";
echo " </image>\n";
echo "</root>\n";
}
exit;
}
if ($test == 'test_empty') {
$onload = 'example.php?request=xml&test=test_empty';
} else {
$onload = 'example.php?request=xml';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link type="text/css" rel="stylesheet" href="jax-slideshow.css">
<link type="text/css" rel="stylesheet" href="../JaxModal/jax-modal.css">
<script type="text/javascript" src="../common/jax-xmlhttprequest.js"></script>
<script type="text/javascript" src="../common/jax-common.js"></script>
<script type="text/javascript" src="../common/jax-effect.js"></script>
<script type="text/javascript" src="../JaxModal/jax-modal.js"></script>
<script type="text/javascript" src="jax-search.js"></script>
</head>
<body onLoad="jaxSearchRegister('<?=$onload?>', 'example', true);">
<div class="example_indent">
<div id="example"></div>
</div>
<a href="example.php">Test with normal xml return</a><br />
<a href="example.php?test=test_empty">Test with empty xml return</a><br />
<br />
</body>
</html>