err on php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
forgun
Forum Commoner
Posts: 61
Joined: Wed Jan 29, 2003 6:05 am
Contact:

err on php code

Post 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??
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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 ''
Post Reply