i have this log in script, so far it works fine untill the instruction told me to add this script at the top of my php file:
<?php
session_start();
include("config.php");
$db = mysql_connect("$db_host", "$db_user", "$db_pwd");
$dbsel = mysql_select_db("$db_name");
$query = "SELECT sid FROM login_1 WHERE id='$id_log'";
@ $result = mysql_query($query);
if (!result) { echo "Sorry, the connection to the database was refused. Please review the 'config.php' file";}
$data = mysql_fetch_array($result);
if ($data['sid']==session_id()) {}
else {echo "<center><font face='Tahoma, Helvetica'>Sorry, you are not authorized to view this page. Please
login <a href='login.php'>here</a>.";die;}
?>
<html>
<frameset rows="81,*" frameborder="NO" border="0" framespacing="0">
<frame name="top" scrolling="NO" noresize src="top.html" marginwidth="0" marginheight="0" >
<frame name="mainFrame" src="web.php" marginwidth="0" marginheight="0" noresize>
</frameset>
<noframes>
<head>
</head>
<body>
</body>
</html>
but it keeps asking me to log in. but whe i ad this one:
<?php
session_start();
if ($sid==session_id()) {}
else {echo "sorry";die;}
?>
it lets me in. i rather use the first code than this one one. i look at that code and it feels something doesnt look right .🙁