Page 1 of 1

i have a prob with php code

Posted: Mon Feb 10, 2003 6:11 am
by forgun
the code on page one:

Code: Select all

<?php
if (!isset($idpage)) {
	header("location: http://" .$_SERVER['HTTP_HOST'] .$_SERVER['PHP_SELF'] . "?type=htm/php&idpage=main");
} 
else {
session_start();
session_register("types");
session_register("idpages");
$types = $type;
$idpages = $idpage;
}

?>
the code on page two:

Code: Select all

<?
include("includes/dbs.php");
$lk = mysql_connect($serv,$user,$pass) or die (mysql_error());
mysql_select_db($dbname[0],$lk);
$type = $_SESSION['types'];
$idpage = $_SESSION['idpages'];
switch ($type) {
	case "htm/php":
	$qur = "select kayword , path from linkssets  order by id desc ";
	$res = mysql_query($qur) or die (mysql_error());
	$row = mysql_fetch_assoc($res);
	if ($idpage == $row['kayword']) {
		$inc = $row['path'];
	}
	else {
		echo "Url error";
	}
	break;
}
?>
<html>
<body bgcolor="#808080">
<? include($inc); ?>#line of error
</body>
</html>
the error

Code: Select all

Warning: Failed opening '' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site13/fst/var/www/html/mainpage.php on line 23
why ????

Posted: Mon Feb 10, 2003 6:13 am
by twigletmac
Is this the same problem as this:
viewtopic.php?p=29859&highlight=#29859

Mac

Posted: Mon Feb 10, 2003 6:17 am
by forgun
some yes but form that i fix i thing the prob now my prob is with the sesstion i need to know why i can read form that session that i put there is wont read at

Posted: Mon Feb 10, 2003 8:04 am
by patrikG
Warning: Failed opening '' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site13/fst/var/www/html/mainpage.php on line 23
You did not specify a filename to include

(include_path='.:/php/includes:/usr/share/php')

I suppose the error lies in one of your include files which assigns a value to $inc .

Posted: Mon Feb 10, 2003 8:06 am
by forgun
i know but why i dont know

Posted: Mon Feb 10, 2003 8:11 am
by patrikG
check your include files.