Hello all! ok I have a quick question, on my login page I have a session that opens so that the users details can be opened on the next few pages. The username and password box are in the same form and the session, as its supposed to, is declared at the top of the code b4 the form iteself, however, when I have the form as:
<form action = " Logged In/WelcomeUserPage.php">
It works great but it does not check the username and password using the sql at the top of the code. When I have the form as:
<form method="post" onReset="MM_displayStatusMsg('Please enter your ClientID and Password');return document.MM_returnValue">
The SQL at the top of the page cross checks the user in the DB and logs them in if the fields are correct but does not implement the session and therefore I cannot get the users details on the other pages. Has anyone any idea how I could use the username and password authentication check (the SQL) and start the session as well. Just in case you need to see the SQL, it is:
session_start(); ?>
<?php
$sql = "SELECT ClientID, cpassword FROM clientinfo
WHERE ClientID='$ClientID'
AND cpassword='$Password'";
$result = mysql_query($sql)
or die("Error: MySQL said ".mysql_error());
$num = mysql_num_rows($result);
$row = mysql_fetch_assoc($result);
if ($num == 1)
header("location: Logged In/WelcomeUserPage.php?"
;
?>
//THE CODE FOR THE FORM ETC.... COMES NEXT!!!!!!!!!!!!!!!!
Does any one have any ideas, its driving me crazy. Cheers for the help.
<form action = " Logged In/WelcomeUserPage.php">
It works great but it does not check the username and password using the sql at the top of the code. When I have the form as:
<form method="post" onReset="MM_displayStatusMsg('Please enter your ClientID and Password');return document.MM_returnValue">
The SQL at the top of the page cross checks the user in the DB and logs them in if the fields are correct but does not implement the session and therefore I cannot get the users details on the other pages. Has anyone any idea how I could use the username and password authentication check (the SQL) and start the session as well. Just in case you need to see the SQL, it is:
session_start(); ?>
<?php
$sql = "SELECT ClientID, cpassword FROM clientinfo
WHERE ClientID='$ClientID'
AND cpassword='$Password'";
$result = mysql_query($sql)
or die("Error: MySQL said ".mysql_error());
$num = mysql_num_rows($result);
$row = mysql_fetch_assoc($result);
if ($num == 1)
header("location: Logged In/WelcomeUserPage.php?"

?>
//THE CODE FOR THE FORM ETC.... COMES NEXT!!!!!!!!!!!!!!!!
Does any one have any ideas, its driving me crazy. Cheers for the help.