Hi, munnik,
thankyou for u'r help.
I am getting the following warning while closing session.
Warning: Trying to destroy uninitialized session in
c:\www\logout.php on line 3
session closed for 85744 Plz do the needful. I am sending the following files.
logout.php
<?php
session_unregister(emp_id); session_destroy(); echo "session closed for $emp_id"; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Thankyou </TITLE> <meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache"> <meta http-equiv="Pragma" CONTENT="no-cache"> </HEAD>
<BODY background="nightsky.gif"
text="white">
<p>
<center><h1>THANKYOU FOR USING IMAC
TOOL</h1></center><br><br>
<center> <h3>Do you want to login again?</h3><a href="login.php">clickhere</a> </center> </p>
</BODY> </HTML> Authentication.php
<?php
header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); // Connect to MySQL mysql_connect( 'localhost', 'balaji',
'pingpong' )
or die ( 'Unable to connect to server.' ); // Select database on MySQL
server
mysql_select_db( 'imac'
)
or die ( 'Unable to select database.' ); // Formulate the query
$sql = "SELECT * FROM employee
WHERE
emp_id = '$emp_id' AND emp_pass = '$emp_pass'"; // Execute the query and put results in
$result
$result = mysql_query( $sql
)
or die ( 'Unable to execute query.' ); // Get number of rows in
$result.
$num = mysql_numrows( $result
);
if ( $num != 0 ) {
// A matching row
was found - the user is authenticated.
$auth =
true;
session_start(); session_register(emp_id); $row =
mysql_fetch_object($result);
if
($row->user_type=='S')
{ include('super.php'); }
else if ($row->user_type=='O') { include('ordinary.php'); }
} else
{ file://User does not exist or not authenticated. echo '<center><h1>Authorization Required.</h1></center>'; header( 'WWW-Authenticate: Basic realm="Private"' ); header( 'HTTP/1.0 401 Unauthorized' ); exit; } ?>
Thanks in advance With warm Regards
-Balaji
|
----------------------------------------------------------------------------------------------------------------------- Information transmitted by this E-MAIL is proprietary to Wipro Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail from your records. ------------------------------------------------------------------------------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]