Location: PHPKode > scripts > phpRetrieve > phpRetrieve/loadQuery.php
<?php
session_start();

	$filename = $_GET['rpt'];
	
	$tbl = "";
	$viewFields = "N";
	unset($_SESSION['session_Criteria']);
	unset($_SESSION['session_Query']);
	$_SESSION['session_View'] = "Design";
			
	//reset report variables
	$_SESSION['session_rptOwner'] = $currentUser;
	$_SESSION['session_rptBuild'] = $build;
	$_SESSION['session_rptDate'] = date("Y-m-d");
	$_SESSION['session_rptName'] = "Report_".strtotime(date("Y-m-d H:i:s"));
	$_SESSION['session_rptDatabase'] = $database;
	$_SESSION['session_rptShare'] = "No";
	$_SESSION['session_rptTable'] = $tbl;

	$readHeader = 'Y';
	$readQuery = 'Y'; 
	
	$arr = array();
	$rptOwner = "";
	$msg = "Unable to open report.";
	
	@Include($filename);

	if($rptOwner != ""){
	
		if($rptTable == "n/a"){ $rptTable = ""; }
		
		$_SESSION['session_Criteria'] = $arr;
		$_SESSION['session_rptName'] = $rptName; 
		$_SESSION['session_rptShare'] = $rptShare; 
		$_SESSION['session_rptOwner'] = $rptOwner;
		$_SESSION['session_rptDate'] = $rptCreated;
		$_SESSION['session_rptDatabase'] = $rptDatabase;
		$_SESSION['session_rptTable'] = $rptTable;
		$_SESSION['session_Table'] = $rptTable;
		$_SESSION['session_rptBuild'] = $rptBuild;
		$_SESSION['session_Query'] = $rptQuery;
		
		$msg = "Report loaded successfully.";
	}
	
	header('Location: index.php?msg='.$msg);
	
?>
Return current item: phpRetrieve