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"; ?> </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> { } ?> </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/> $zapytanie = "select * from filmy order by filmid desc limit 5"; for($i=0; $i<$ile_znalezionych;$i++) { } ?> </div> <div class="random_film"> <?php $zapytanie = "select * from filmy order by RAND() limit 1"; for($i=0; $i<$ileznalezionych; $i++) { } ?> </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 { $user=$_POST['user']; $pass = $_POST['pass']; $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 { } else { { } else { } echo'<tr><td colspan="2" align="right"><a class="registerA" href="register.php">rejestracja</a></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 ?