ok, before this script, there is one that authenticate user from mysql, i'll paste it to the end, and after successfull login require ("frameset.php")
there is frames. And in right frame is this script what i post here. so in the right frame there is Access granted and logged in $users_real_name
if this right.php is the only page, i mean from login script it goes srtaight to right.php it works fine. But not in frames..
here is the login script:
<?
function do_error($error) {
echo "<p><center>DO NOT, NOT TRY TO USE<br>";
echo "THIS SITE WITHOUT CORRECT USERNAME AND PASSWORD !!!<br>";
echo "REMEBER..... I TOLD YOU......";
die;
}
if (!$db = @mysql_connect("localhost","$username", "$pass")) {
$db_error = require("denied.php");
do_error($db_error);
}
if (!$ac = @mysql_select_db("myaccessdb")){
$db_error = require("denied.php");
do_error($db_error);
}
$sql = "SELECT *
FROM users
WHERE username='$PHP_AUTH_USER' and password='$PHP_AUTH_PW'";
//Execute the query and put results in $result
$result = mysql_query($sql);
// Get number of rows in $result. 0 if invalid, 1 if valid.
$num = mysql_numrows($result);
if ($num != "1") {
require("frameset.php");
exit;
}
?>
thats it.. and here is the errors when its in right.php:
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in <b>/path/to/file/right.php</b> on line <b>25</b><br>
<br>
<b>Warning</b>: Failed opening '.php' for inclusion (include_path='.:/usr/local/lib/php') in <b>/path/to/that/right.php</b> on line <b>33</b><br>
huh...
thanks