[mapserver-users] login session php with chameleon framework

lovelietha armaluvly_88 at yahoo.com
Mon Jul 11 01:59:18 EDT 2011


Hi all,
i used chameleon framework for webgis,,when i made a login session on my
page login,,the session doesn't working..the session on standard login has
working,,but when i redirect the session it doesn't working.
anyone can help me explain what happen or what i have supposed to do?? code
is below :


*Login.html code :*
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border = "0" width="1000" align="center" cellspacing="0">
<th colspan = "5" > ./images/banner.png </th>
	<tr>
		<th width= " 200" height="50"> Home.phtml  Home  </th>
		<th>  ../Peta.phtml  Map  </th>
		<th>  Analisis.phtml  Analisis  </th>
		<th>  ../Login.phtml  Login  </th>
		<th>  Contact.phtml  Contact  </th>
	</tr>
		<tr>
			<th bgcolor="FFFF66"> <br>
			 ProfilBjm.html  Profil Banjarmasin  </th>
	<form action="Template%20Web/LoginCheck.php" method="post">
			<td rowspan="2" colspan ="4" align="center" width= "200">
			User Name :
			<input type="text" name ="user_name"
				size="15" maxlength="15">
			<br>
			<br>
			Password :
			<input type="password" name ="password"
				size="15" maxlength="15">
			<br>
			<br>
			<input type = "submit" value = "Login" name="submit">
			<input type = "reset" value = "Reset">
			</td>
			
		<tr>
			<th  rowspan="2" bgcolor="FFFF66" valign="top">
			 ProfilDBD.html  Profil DBD  </th>
			
		</tr>
		<tr>
			<td colspan="4"></td>
		</tr>
	
       </form>
	   
</table>
</body>
</html>



*Login.phtml code :*
<?php
include("./chameleon.php");
$szTemplate="./Template Web/Login.html";
$szMapFile="../Map/LISA_epi05.map";
class SampleApp extends Chameleon
{
	function SampleApp()
	{
		parent::Chameleon();
		$this ->moMapSession = new MapSession_RW;
		$this ->moMapSession-> setTempDir ( getSessionSavePath());
	}
}
$oApp= new SampleApp();
$oApp-> registerSkin('skins/sample');
$oApp->CWCInitialize($szTemplate,$szMapFile);
$oApp->CWCExecute();
?>



*Login1.php code :*
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border = "1" width="1000" align="center" cellspacing="0">
<th colspan = "5" > ./images/banner.png </th>
	<tr>
		<th width= " 200" height="50"> Home.phtml  Home  </th>
		<th>  ../Peta.phtml  Map  </th>
		<th>  Analisis.phtml  Analisis  </th>
		<th>  ../Login.phtml  Login  </th>
		<th>  Contact.phtml  Contact  </th>
	</tr>
		<tr>
			<th bgcolor="FFFF66">
			<form>
			 <br>
			Pilih Masukan Data :<br>
			   </th>
			<td rowspan="2" colspan ="4" align="center" width= "200">
			
			</td>
			
		<tr>
			<th  rowspan="2" bgcolor="FFFF66" valign="top">
			
			<select name = "indikator">
			<option value = "Epidemic">Epidemic
			<option value = "Epidemic">Penduduk
			<option value = "Epidemic">Kepadatan Penduduk
			<option value = "Epidemic">Mobilitas Datang
			<option value = "Epidemic">Mobilitas Pergi</option></select>
			
			</th>
			
		</tr>
		<tr>
			<td colspan="4"></td>
		</tr>
		</form>
</table>
</body>
</html>



*Login1.phtml code :*
<?php
include("./chameleon.php");
//include_once(COMMON."session/session.php");
//installSessionDirectoryHandler();
//initializeSession("sid", "/tmp/");

if (!isset($_SESSION["USER"]))
{
	echo "a";
}else
{
	echo "test";
}

$szTemplate="./Template Web/Login1.php";
$szMapFile="../Map/LISA_epi05.map";
class SampleApp extends Chameleon
{
	function SampleApp()
	{
		parent::Chameleon();
		$this ->moMapSession = new MapSession_RW;
		$this ->moMapSession-> setTempDir ( getSessionSavePath());
	}
}
$oApp= new SampleApp();
$oApp-> registerSkin('skins/sample');
$oApp->CWCInitialize($szTemplate,$szMapFile);
$oApp->CWCExecute();
?>


*LoginCheck.php code :*
<?php
	include("../Moran/Connection.php");
		
	if(!empty($_POST["submit"]))
	{
		$DBResource = new Connection();
		$DataRes = $DBResource->ExecuteQuery("SELECT \"User_name\" FROM tb_admin
WHERE \"User_name\" ='".$_POST["user_name"]."' AND \"Password\" =
'".$_POST["user_name"]."'");
		$Data = array();
		while ($resAray = pg_fetch_array($DataRes, null, PGSQL_ASSOC)) {
   			$Data = $resAray;
		}
		
		if(!empty($Data["User_name"]))
		{
			$_SESSION["USER"] = $Data["User_name"];
			header("location:../Login1.phtml");
		}
		else
		{
			header("location:../Login.phtml");
		}
	}
?>


Anyone,,any suggestions would be helpfull

Thanks


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/login-session-php-with-chameleon-framework-tp6569844p6569844.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list