Location: PHPKode > projects > Wexplorer > weXplorer/config.php
<?php
/*
 * Created on 8 nov. 2005
 *
 */
require_once('config.inc.php');
session_start();
?>
<html>
<head>
<title>Query</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>

<table border="1">

<?php
if(!isset($_SESSION['logged'])){ 
	if(trim($_POST['query'])==ADMIN_PASSWD){
		unset($_POST['query']);
		$_SESSION['logged'] = true;
		echo "Submit 'bye' to log out.";
	}  else if(trim($_POST['query'])!="")
		echo "Wrong pass phrase. Please log in";
	else 
		echo "Please log in";
} else if(trim($_POST['query'])=="bye"){
	session_destroy();
	//unset($_POST['query']);
}
if(isset($_SESSION['logged'])){	
	if (isset($_POST['query'])&&trim($_POST['query']!="")&& trim($_POST['query']!="bye")){
		$_POST['query']=	stripcslashes($_POST['query']);
		file_put_contents('weXplorer.ini',$_POST['query'] );
	} else if (isset($_POST['query'])&&trim($_POST['query']=="bye")){
		$_POST['query'] = "See you.";
	} else {
	 	$_POST['query'] = file_get_contents('weXplorer.ini');
	}
} 

?>

<table>
<form name="query" method="post" action="">
  <textarea id="queryarea" name="query" cols="80" rows="20"><?php echo $_POST['query']; ?></textarea>
  <input type="submit" name="Submit" value="Submit">
</form>
<script language="JavaScript" type="text/javascript">
	document.getElementById('queryarea').focus();
</script>
</body>
</html>
Return current item: Wexplorer