I'm working on a simple session management program for logging in and I can't seem to
get the information to properly display. I would really appreciate a second look from
someone.
Code is below
<?
//main line
session_start()
session_register("FirstName");
session_register("Email");
ConnectDB();
global $objConn;
if ($_SESSION["FirstName"] == null && $_REQUEST["Email"])
{
Login_Form();
}
else
{
if ($_REQUEST["Email"] != null)
{
$strSQL = "SELECT * FROM users WHERE Email = '"
.$_REQUEST["Email"]."' AND FirstName = '".$_REQUEST["FirstName"]."'";
$rs = $objConn->Execute($strSQL);
if ($rs->EOF)
{
Access_Denied();
}
else
{
$_SESSION["FirstName"] = $rs->fields["FirstName"];
$_SESSION["Email"] = $rs->fields["Email"];
//redirect at this point
}
}
}
//---------------------------------------------------------------------------------------------
function ConnectDB()
{
global $objConn;
$db_type = "mysql";
$db_location = "localhost";
$db_uid = "xxx";
$db_pwd = "xxx";
$db_name = "login";
include("wrapper/adodb.inc.php");
$objConn = NewADOConnection($db_type);
$objConn->Connect($db_location, $db_uid, $db_pwd, $db_name);
$objConn->debug = false;
}
I'm kind of lost here.... I'm new to PHP, but have developed in both Perl and TCL
before so the syntax is familiar.
Thanks for the help in advance,
Jeremy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php