Page 1 of 1

err on php code

Posted: Fri Feb 07, 2003 4:33 pm
by forgun

Code: Select all

Warning: Failed opening '' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site13/fst/var/www/html/main.php on line 20
the error
the code is

Code: Select all

<?
if (!isset($type)) {
    header("location: http://" .$_SERVER['HTTP_HOST'] . "/main.php?type=htm/php&idpage=main");
}
include("includes/dbs.php");
$lk = mysql_connect($serv,$user,$pass) or die (mysql_error());
mysql_select_db($dbname[0],$lk);
$qur = "select * from linkssets";
$res = mysql_query($qur) or die (mysql_error());
while ($row = mysql_fetch_assoc($res)) {
	if ($type = "htm/php") {
		if ($row['kayword'] == $idpage) {
			$inc = $row['path'];
		}
	}
}
?>
<html>
<body>
<? include($inc); ?>
</body>
</html>
why??

Posted: Fri Feb 07, 2003 9:10 pm
by Stoker
obveiously $inc has not been set to anything.. btw, this is a huge security risc, unless all the epxressions where true it would never be assigned and could be forged by url if register_globals is on..

either or:
-the query didnt return anuthing
-$type was never mated
-$rowp['kayword'] never matched $idpage
-the value of $row[path] in the last mathcing was null or ''