Location: PHPKode > projects > JaxBlog > JaxBlog/module/JaxScoreboard/example.php
<?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>\n";
		
	} else {
		echo "<root>\n";
		echo "	<meta>\n";
		echo "		<scheduled_date>Sep 5th, 2005</scheduled_date>\n";
		echo "		<guest_name>Eastlake</guest_name>\n";
		echo "		<guest_runs>5</guest_runs>\n";
		echo "		<guest_hits>0</guest_hits>\n";
		echo "		<guest_errors>0</guest_errors>\n";
		echo "		<home_name>Bozo The Clown</home_name>\n";
		echo "		<home_runs>3</home_runs>\n";
		echo "		<home_hits>0</home_hits>\n";
		echo "		<home_errors>2</home_errors>\n";
		echo "	</meta>\n";
		echo "	<guest><i1>0</i1><i2>1</i2><i3>0</i3><i4>4</i4><i5>0</i5><i6>0</i6><i7>0</i7></guest>\n";
		echo "	<home><i1>0</i1><i2>0</i2><i3>0</i3><i4>0</i4><i5>1</i5><i6>2</i6><i7>0</i7></home>\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-scoreboard.css">
<script type="text/javascript" src="../common/jax-common.js"></script>
<script type="text/javascript" src="../common/jax-xmlhttprequest.js"></script>
<script type="text/javascript" src="jax-scoreboard.js"></script>
</head>

<body onLoad="jaxScoreboardRegister('<?=$onload?>', 'example');">

<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>

</body>
</html>
Return current item: JaxBlog