Page 1 of 1

can't get admin login to work

Posted: Fri Dec 06, 2002 12:11 am
by justinb
Hello,
I am trying to create a login page for my admin site, which starts a session, If the admin name and pass are in db (logged in), they get a main menu buttun and a session is started. If not in db they get a try again link. Whats happeneing is that the page is coming up blank, no errors, just blank.

The do_html_url() function is a function in outputFns.php which diplays the links. This is my code , can someone help please.

<html><head></head><body>
<?
include_once("outputFns.php");
?>
<?
function login($username, $password)

{ // begin login function
// this function checks the username and password with the db table for admin users
// connect to db
// check if username is unique
$db_name = "xxxxxxxxxxx";

$table = "admin";

//1

$connection = @mysql_connect("xxxxxxx", "xxxxxxx", "xxxxx") or die("Problems connecting - Try again");

//2

$result = mysql_query("SELECT adminID, adminName, adminPass FROM '$table' WHERE adminName='$username' AND adminPass ='$password'");

if(!$result)

do_html_url("login.php", " Wrong Login Infromation try agin");


if(mysql_num_rows($result) > 0)

do_html_url("MenuView.php", " Welcome to the Adminsitration Site");
session_register('valid');
$valid = "yes";

else

do_html_url("login.php", " Wrong Login Infromation try aagin");


} // end login() function
?>
</body></html>

Posted: Fri Dec 06, 2002 6:09 am
by volka
but there are errors (at least one ;) )
PHP Parse error: parse error, unexpected T_ELSE in test.php on line 35

Posted: Fri Dec 06, 2002 8:03 am
by justinb
hello,
I tried removing that else statement, but it made no difference, this is really wierd, how do I make it so I can see my errors ?, its enabled in IE, I'm getting java errors all over the place.