Notice: Undefined index:

Slide

Registered
Здравейте,
имам един проблем с php страницата.Излиза някакви грешки от рода
"Notice: Undefined index:"

Код:
Notice: Undefined index: lgsl_debug in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 840
Notice: Undefined index: lgsl_debug in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 855
Notice: Undefined index: prefix in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 302
Notice: Undefined index: prefix in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 128
Notice: Undefined index: comment in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 176
Notice: Undefined index: prefix in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 246
Notice: Undefined index: pending in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 431
Notice: Undefined index: pending in /home/***/public_html/lgsl/lgsl_files/lgsl_class.php on line 434

Notice: Undefined index: id in /home/***/public_html/baner.php on line 4
Notice: Undefined index: id in /home/***/public_html/baner.php on line 5

Notice: Undefined index: id in /home/***/public_html/banner.php on line 5
Notice: Undefined index: id in /home/***/public_html/banner.php on line 6

Как мога да отстраня проблема.
Благодаря!
 
Сложи в началото на файла
Код:
error_reporting(E_ALL ^ E_NOTICE);
това ще скрие грешката, но няма да я реши. Това показва, че първо трябва да дефинираш (създадеш) променливата преди да започнеш да работиш с нея. :?:
 
Да, като добавих това вече не ги показва.
НО сега ми излиза друга грешка:

Код:
PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/***/public_html/banners.php:5) in /home/***/public_html/banner.php on line 14
 PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/***/public_html/banners.php:5) in /home/***/public_html/baner.php on line 13

baner.php 13 ред
Код:
header("LOCATION: $website");
banner.php 14 ред
Код:
header("LOCATION: $website");
 
Извинявам се за повторния пост, но грешката си продължава да излиза и аз нищо не мога да направя
 
Ето кода:
Код:
<?php
include("config.php");
$position = (preg_match('/^[1-9]+$/',$banner_position)) ? $banner_position : false;
$gid = (preg_match('/^[1-9]+$/',$_GET['id'])) ? $_GET['id'] : false;
if($_GET['id'])
{
	$db = mysql_query("SELECT `website` FROM `adv_clients` WHERE `id` = '$gid' LIMIT 1")or die(mysql_error());
	if(mysql_num_rows($db) == 1)
	{
		$row = mysql_fetch_assoc($db);
		$website = $row['website'];
		mysql_query("UPDATE `adv_clients` SET `clicks` = (`clicks` + 1) WHERE `id` = '$gid'")or die(mysql_error());
		header("LOCATION: $website");
	}
}
else
{
	$db = mysql_query("SELECT `id`,`banner`,`website` FROM `adv_clients` WHERE `period` > `impressions` 
													AND `position` = '$position' ORDER BY RAND() LIMIT 1")or die(mysql_error());
	if(mysql_num_rows($db) == 1)
	{
		$row = mysql_fetch_assoc($db);
		$id = $row['id'];
		$banner = $row['banner'];
		$website = $row['website'];
		echo '<a href="baner.php?id='.$id.'" target="_Blank" ><img src="'.$banner_dir.'/'.$banner.'" alt=""></a>';
		mysql_query("UPDATE `adv_clients` SET `impressions` = (`impressions` + 1) WHERE `id` = '$id'")or die(mysql_error());
	}
	else
	{
		echo "<a href='http://bg-cs.info/'><img src='images/88x31.png' border='0' alt=''></a>";
	}
}
?>
 
Код:
<?php
error_reporting(E_ALL ^ E_NOTICE);
include("config.php");
$position = (preg_match('/^[1-9]+$/',$banner_position)) ? $banner_position : false;
$gid = (preg_match('/^[1-9]+$/',$_GET['id'])) ? $_GET['id'] : false;
if($_GET['id'])
{
	$db = mysql_query("SELECT `website` FROM `adv_clients` WHERE `id` = '$gid' LIMIT 1")or die(mysql_error());
	if(mysql_num_rows($db) == 1)
	{
		$row = mysql_fetch_assoc($db);
		$website = $row['website'];
		mysql_query("UPDATE `adv_clients` SET `clicks` = (`clicks` + 1) WHERE `id` = '$gid'")or die(mysql_error());
		header("LOCATION: $website");
	}
}
else
{
	$db = mysql_query("SELECT `id`,`banner`,`website` FROM `adv_clients` WHERE `period` > `impressions` 
													AND `position` = '$position' ORDER BY RAND() LIMIT 1")or die(mysql_error());
	if(mysql_num_rows($db) == 1)
	{
		$row = mysql_fetch_assoc($db);
		$id = $row['id'];
		$banner = $row['banner'];
		$website = $row['website'];
		echo '<a href="baner.php?id='.$id.'" target="_Blank" ><img src="'.$banner_dir.'/'.$banner.'" alt=""></a>';
		mysql_query("UPDATE `adv_clients` SET `impressions` = (`impressions` + 1) WHERE `id` = '$id'")or die(mysql_error());
	}
	else
	{
		echo "<a href='http://bg-cs.info/'><img src='images/88x31.png' border='0' alt=''></a>";
	}
}
?>
 

Back
Горе