This is how i am sending my session ID.
header('Location: http://www.domainname.com/ok.php?'.sid );
I have never tryed setting cookies. Do i need to u the setcookie() command?
Here is the code:
+++++++++++++++++++++++++++++++++++++++++++==
<?php
session_start();
session_register("auth");
$auth = false; // Assume user is not authenticated
if ($username != "" && $password != "") {
// Connect to MSSQL
mssql_connect( 'SQL2K')
or die ( 'Unable to connect to server.' );
// Select database on MSSQL server
mssql_select_db( 'table_name' )
or die ( 'Unable to select database.' );
// Formulate the query
$sql = "SELECT * FROM WEB_Access_Verification WHERE
username = '$username'";
// Execute the query and put results in $result
$result = mssql_query( $sql )
or die ( 'Unable to execute query.' );
// Get number of rows in $result.
$num = mSsql_num_rows( $result );
if ( $num != 0 ) {
// A matching row was found - the user is authenticated.
$result0 = mssql_result( $result, 0, realpassword )
or die ( 'Unable to get result. ');
if ( $result0 != $password){
// session_register($auth);
$auth = false;
} else {
//session_register($auth);
$auth = true;
}
}
}
//$sessionid = session_id();
if ( ! $auth ) {
header('Location: http://www.domainname.com/error_index2.php' );
exit;
} else {
header('Location: http://www.domainname.com/ok.php?'.sid );
}
?>