<? function spr() { if (($_POST['login']=="Jan")&&($_POST['pas']=="2007")) {return true;} else {return false;} } ?> .... <? { if (spr()==true) { } else { } } else { } ?> .... <? if (spr()==true) { echo "<a href="edycjaRAN.php" target="ramka"><font color="orange" size="2"><b>Edycja rankingu graczy</b></font></a><br>"; echo "<a href="edycjaTD.php" target="ramka"><font color="orange" size="2"><b>Edycja rankingu TD</b></font></a><br>"; echo "<a href="edycjaTD.php" target="ramka"><font color="orange" size="2"><b>Napisz NEWSA</b></font></a><br>"; } ?>
Jak widać logowanie jest w jednym pliku, i po zalogowaniu usera Jan są dostępne odpowiednie linki do podstron. Wtedy taki user wchodz na na pod stronę Edycja rankingu graczy. oto jej kod:
<html> <head> <title>dynamiczny formularz</title> <? function sortuj() { for($i=0;$i<$ile;$i++) { } $n); for($i=0;$i<$ile;$i++) { } } ?> </head> <body> <h3 align=center>Edycja graczy rankingowych</h3> <form name="formularz" action="edycja.php" method="post"> <? //petla_Główna { { sortuj(); } { for ($i=0;$i<$n;$i++) { } } $lp=1; for($i=0;$i<$n;$i++) { echo "<tr align="center"><td>$lp</td><td>$nick[$i]</td><td><font color=red>$punkty[$i]</font></td><td> Zmień: <input type=text name=pts[$i] value=$punkty[$i] size="7"></td></tr>"; $lp++; } echo "Nick : <INPUT TYPE=TEXT NAME=nnick value=""> punkty: <INPUT TYPE=TEXT NAME=npunkty VALUE=""><INPUT TYPE=SUBMIT VALUE="DODAJ"></FORM>"; } ?> </body> </html>
Jak widać jest to prosta baza danych operująca na 1 pliku. User Jan widzi wczytane z pliku rekordu i może zedytować wyniki graczy lub dodać nowego. I tu zaczyna się problem, otóż gdy sprawdzałem te dwie strony oddzielnie to działały bez zarzutu natomiast gdy przechodze do edytowania graczy po uprzednim zalogowaniu się (czyli od strony pierwszej) widze coś takiego :
Cytat
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
I nie wiem jak Z tym koksem sobie poradzić. Bardzo proszę o pomoc... możliwe z wyjaśniem jak dla laika
Z góry dziękuje za każdą pomoc.
Hmm ok już wiem że kod jest wporządku i to coś z ustwieniami serwera. Używam PHPTraid 2.2 który instaluje PHP w wersji 4.1.1 jako CGI na Apachu 1.2.3 Jeśli chodzi o ustwienia apache to jestem zielony może ktoś mi pomoc jak ustwić uprawnienia żeby był dostęp do pliku bez problemowy ?. Apache stoi na Win XP