<?php
// Start our session
session_start();
$_SESSION['LoggedOn'] = 'False';
// REQUIRE this as failed include would break the script !
require("connection.php");
// Use HTMLentities to prevent injection of code
$UsrIDVar = htmlentities($_POST['UsrID']);
$Psswd = htmlentities($_POST['Psswd']);
$query = "SELECT * FROM logon WHERE UsrID = '$UsrIDVar' AND Psswd = '$Psswd'";
$dbresult = mysql_query($query, $dblink);
$count = mysql_num_rows($dbresult);
$row = mysql_fetch_array($dbresult);
if($count==1)
{
$_Session['LoggedOn'] = 'True';
Header("location:Menu.php?Alevel={$row["Alevel"]}");
} else {
Header("location:Index.php");
}
?>
Its not a difficult language to learn.. there is also a new php-gtk extension which will (in simple terms) allow you to write stand alone grapihcal programs.
$row = mysql_fetch_array($dbresult);
if($count==1)
{
$_SESSION['LoggedOn'] = 'True';
$_SESSION['username'] = $row['username'];
Header("location:Menu.php?Alevel={$row["Alevel"]}");
} else {
Header("location:Index.php");
}
?>
Have you used gtk? I'm currently using gtk2 and finding it a bit hard to find good documentation for it :dapprove: Wondered if you knew anywhere.
I get this error when i put session_start(); on the menu.php
"Fatal error: Call to undefined function start_session() in D:\mysqlwork\xampp\htdocs\Menu.php on line 1"
yeah on my menu.php i have
"<?php start_session();
print_r($_SESSION) ;
echo $_Session['LoggedOn'];?>"
and it wont work?
Have you used gtk? I'm currently using gtk2 and finding it a bit hard to find good documentation for it :dapprove: Wondered if you knew anywhere.
It is all there on the php gtk website (http://gtk.php.net).
However, if you've never written a program for an event based OS (like gtk, windows, carbon etc) then it's going to be a bit of a shock to the system.
Maybe a good read up on the standard "C" GTK api might give you a bit more flavour of how it all works, plenty of tutorials on the web.
yay its now working thanks for your help guys