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>