PHP Output Not Working

Hey folks,

Pretty simple operation, confusing results. I have a PHP file that queries a database and outputs the following:


length=3&id1=1&orderid1=&title1=Home&id2=2&orderid2=&title2=About&id3=3&orderid3=&title3=Articles

Simple string of variables, as seen through my web browser. However, when I load the file into Flash, it outputs the actual PHP code and not the string output.


private var requester:URLRequest = new URLRequest();
private var loader:URLLoader = new URLLoader();
private var requester_vars:URLVariables = new URLVariables();

private var url:String = "data-navigation.php";

function Navigation(xmlInfo:XML) {
	xml = xmlInfo;
	
	requester_vars.key = "navigation";
	requester.data = requester_vars;
	requester.method = URLRequestMethod.POST;
	requester.url = url;
	loader.load(requester);
	loader.addEventListener(Event.COMPLETE, onComplete);

	function onComplete(e:Event):void {
		var loader:URLLoader = e.target as URLLoader;
		trace(loader.data);

		if (loader != null) {
			//URLVariables data
		} else {
			trace("loader is not a URLLoader");
		}
	}
}

Now, I know you need a URLVariables object to parse the variable string, but I’m not getting that far. Right now the script outputs:


<?php

	include_once ("database.php");

	$query = "SELECT * FROM pages WHERE visible<>0 ORDER BY orderid ASC";

	$result = mysql_query($query) or die("OOPS! Query on pages didn't work!");

	$num_rows = mysql_num_rows($result);

	echo 'length=' . $num_rows . '&';

	for ($i=1;$i<=$num_rows;$i++) {

		$row = mysql_fetch_array($result);

		$id = $row['id'];

		$orderID = $row['orderid'];

		$title = $row['title'];

		echo 'id' . $i . '=' . $id . '&';

		echo 'orderid' . $i . '=' . $orderid . '&';

		echo 'title' . $i . '=' . $title . '&';				
	}

	mysql_close($connection);

?>

Through the Trace window in Flash. So Flash is loading in the actual text of the document, not the output. Which is extremely odd, because it outputs fine in my browser.