Witam.
Pracując na localhost pojawia się taki błąd:
Notice: Undefined index: prawid_uzyt in F:\www\Filmy\header.inc on line 33
gdy wrzucę na serwer ten komunikat znika i wszystko działa poprawnie
kod header.inc
<div class="header">
<div class="finder">
<form action="rezultat.php" method="post">
<table><tr><td>
<input type="text" name="find" /></td><td>
<input type="submit" value="Szukaj" /></td>
</tr></table></form>
<a href="all_films.php" class="all_films">Wszystkie filmy
<?php
$zapytanie = "select * from filmy";
echo '<strong>('.$ile_znalezionych.')</strong>'; ?> </a>
</div>
<strong><a class="a_finder" href="index.php">Baza filmów</a></strong>
<div class="panel">
<table>
<tr>
<td class="updating">
<script type="text/javascript" language="JavaScript"> document.write("Last update: " + document.lastModified);</script></td</tr>
<tr><td>
<a href="dodaj_film.php" class="updating">Dodaj film</a>
</td></tr>
<tr><td class="updating">
<?php echo $_SESSION['prawid_uzyt'];
if(isset($_SESSION['prawid_uzyt'])) {
echo '<a class="updating" href="wylog.php"> wyloguj</a> </td></tr>'; }
?>
</table>
</div>
</div>
i index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title>Filmy</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="pl" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php require('header.inc');?>
<div class="main">
<div class="results">
<div class="last_added">
<strong>Ostatnio dodane filmy</strong><br/>
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
$zapytanie = "select * from filmy order by filmid desc limit 5";
for($i=0; $i<$ile_znalezionych;$i++)
{
echo '<tr><td class="table_photo"><img alt="" src='; echo ' /></td><td class="table_title">'; }
?>
</div>
<div class="random_film">
<?php
$zapytanie = "select * from filmy order by RAND() limit 1";
for($i=0; $i<$ileznalezionych; $i++)
{
echo '</td</tr></table>'; }
?>
</div>
</div>
</div>
</body>
</html>
a $_SESSION['popraw_uzyt'];
jest zdefiniowany w dodaj_film.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
if(isset($_POST['user']) && isset($_POST['pass'])) {
$user=$_POST['user'];
$pass = $_POST['pass'];
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_polish_ci'"); $zapytanie= "select * from uzytkownicy where login='$user' and haslo=sha1('$pass')";
if($wynik1 > 0)
{
$_SESSION['prawid_uzyt'] = $user;
}
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title>Filmy</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="pl" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php require('header.inc');?>
<div class="main">
<div class="add_film">
<?php
if(isset($_SESSION['prawid_uzyt'])) {
echo "<strong>Dodaj film</strong>";
echo' <form action="dodaj_film_form.php" method="post">'; echo ' <tr><td>ID:</td><td><input type="text" name="filmid"/></td></tr>'; echo '<tr><td>Tytuł:</td><td><input type="text" name="tytul"/></td></tr>'; echo '<tr><td>Gatunek:</td><td><input type="text" name="gatunek"/></td></tr>'; echo '<tr><td>Rok:</td><td><input type="text" name="rok"/></td></tr>'; echo '<tr><td>Język:</td><td><input type="text" name="jezyk"/></td></tr>'; echo '<tr><td>Okładka:</td><td><input type="text" name="zdjecia"/></td></tr>'; echo '<tr><td>Opis:</td><td><input type="textarea" class="textarea_opis" name="opis"/></td></tr>'; echo '<tr><td colspan="2"><input type="submit" value="dodaj"/></td></tr>';
}
else
{
{
echo 'zalogowanie niemożliwe'; }
else
{
}
echo '<div class="log_form">'; echo' <form action="dodaj_film.php" method="post" >'; echo'<tr><td>Login: </td><td><input type="text" name="user"/> </td></tr>'; echo'<tr><td>Hasło: </td><td><input type="password" name="pass"/></td></tr>'; echo'<tr><td colspan="2" align="right"><a class="registerA" href="register.php">rejestracja</a></td></tr>'; echo'<tr><td colspan="2"><input type="submit" value="Zaloguj"/></td></tr>';
}
?>
</div>
</div>
<div class="footer">
<table>
<tr><td>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
</td>
<td>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10-blue"
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
</td></tr></table>
</div>
</body>
</html>
dlaczego na localhost nie działa poprawnie ?