Thread View: pl.comp.lang.php
1 messages
1 total messages
Started by Blod
Mon, 27 Aug 2001 20:52
logowanie
Author: Blod
Date: Mon, 27 Aug 2001 20:52
Date: Mon, 27 Aug 2001 20:52
49 lines
2261 bytes
2261 bytes
witam,
mam skrypt logowania, ktory dane typu login, haslo trzyma w osobnych plikach
w katalogu 'users' Pliki maja nazwe taka jak login oraz rozszezenie .dat
Problem pojawia sie przy tworzeniu panelu sterowania dla administratora.
Ponizej jest fragment pliku administracyjnego. Blad jaki otrzymuje mowi, ze
plik nie istnieje, mimo iz na pewno jest. Bylbym wdzieczny za wszelkie
propozycje :)
<?
if ($action == '') {
echo "<form ACTION=admin.php method=post><br>\n";
echo "<input type=hidden name=action value=del_user>\n";
echo "<select name=user><br>";
$handle=opendir('users');
while (false!==($file = readdir($handle)))
if ($file != "." && $file != "..")
echo "<option value=$file>$file<br>";
}
}
echo "</select>";
echo "<input TYPE=submit value=usun class=submit><br></FORM>";
closedir($handle);
}
if ($action == 'del_user') {
echo "Na pewno chcesz usunąć plik $user?<br>";
echo "<form ACTION=admin.php method=post>";
echo "<input type=hidden name=action value=delete>";
echo "<input TYPE=submit value=TAK class=submit></form>";
echo "<form ACTION=admin.php method=post>";
echo "<input type=hidden name=action value=>";
echo "<input TYPE=submit value=NIE class=submit></form>";
}
if ($action == 'delete') {
echo "user usunięty";
unlink ("users/$user");
}
?>
pozdro
Blod
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads