Location: PHPKode > projects > K-12 OSS Web Software Project > equest_0.1/teacher/validate.php
<?php
include("../config.php");

$query = "SELECT login,password,teacherid FROM teachers WHERE login='{$_POST["login"]}' AND password='{$_POST["password"]}'"; 
$result = mysql_query($query) or die(mysql_error());
$res = mysql_fetch_array($result);
$numrows=mysql_num_rows($result);
	if ($numrows == 1)
      {
		session_register();
		session_start();
		$_SESSION['login'] = $_POST["login"];
		$_SESSION['password'] = $_POST["password"];
		$_SESSION['teacherid'] = $res["teacherid"];
		$_SESSION['teacher']=true;
		header("Location: members.php?".session_name()."=".session_id());
	}
	else 
	{
		print "<p>Could not validate user. Please click back and try again</p>\n";
	}
?>
Return current item: K-12 OSS Web Software Project