i have a prob with 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:

i have a prob with php code

Post 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 ????
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is this the same problem as this:
viewtopic.php?p=29859&highlight=#29859

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

Post 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
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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 .
User avatar
forgun
Forum Commoner
Posts: 61
Joined: Wed Jan 29, 2003 6:05 am
Contact:

Post by forgun »

i know but why i dont know
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

check your include files.
Post Reply