![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 7.11.2005 Ostrzeżenie: (0%) ![]() ![]() |
Witam
![]() Kod <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"><head> <meta http-equiv="Content-type" content="text/xml; charset=iso-8859-2" /> <title>Panel Admina </title> <style type="text/css"><!-- body, td { font-family: arial; font-size: 13px; } a { color:blue;} --></style> </head><body bgcolor="#545c62"> <table><tr><td valign="top"> <img src="images/panel.gif"></img> <P><h2><a href="admin/index.php">Dodaj News</a></h2></P> UtwĂłrz nowy plik o nazwie: <form action="edycja.php" method="get"><div> <input type="text" name="nowy" /><br /> <input type="submit" value="Wykonaj" /> </div></form> <? // zakladanie wskazanego pliku $nowy = $_GET["nowy"]; if ($nowy<>"" and !file_exists($nowy)) { touch($nowy); chmod($nowy, 0664); } else if ($nowy<>"" and file_exists($nowy)) { echo "Plik o podanej nazwie juĹź istnieje!"; } // usuwanie wskazanego pliku $usun = $_GET["usun"]; if ($usun<>"" and file_exists($usun)) { unlink($usun); } // wypisywanie dostÄ™pnych plikĂłw $katalog = opendir("./"); while (false !== ($plik = readdir($katalog))) { if ($plik<>"." and $plik<>".." and $plik<>"edycja.php" ) $lista[]=$plik; } closedir($katalog); if (count($lista)>0) { echo "Wybierz plik do edycji:"; sort($lista); } for ($i=0;$i<count($lista);$i++) { echo "<br /><a href=\"edycja.php?edycja=$lista[$i]\">$lista[$i]</a>"; echo " - <a href=\"edycja.php?usun=$lista[$i]\">usuĹ„</a>"; echo " - <a href=\"$lista[$i]\">zobacz</a>"; } // zmiana zawartosci pliku $edycja = $_REQUEST["edycja"]; if (isset($_POST["tekst"]) and file_exists($edycja)) { $txt = $_POST["tekst"]; if (get_magic_quotes_gpc()) $txt = stripslashes($txt); $f = fopen($edycja, "w"); fputs($f, $txt); fclose($f); } echo '</td><td valign="top" align="center">'; // umieszczenie pliku w formularzu if ($edycja<>"" and file_exists($edycja)) { echo "<p> </p>Edycja pliku: <b>$edycja</b>"; echo '<form action="edycja.php" method="post"><div> <input type="hidden" name="edycja" value="'.$edycja.'" /> <textarea name="tekst" rows="20" cols="50">'; echo htmlspecialchars(file_get_contents($edycja), ENT_QUOTES); echo '</textarea><br /><input type="submit" value="ZmieĹ„" /></div></form>'; } ?> </td></tr></table> </body></html> Teraz potrzebuje takiego skryptu lub modyfikacji tego co napisalem. Z gory dzieki Ten post edytował owen 10.12.2006, 13:24:54 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 19.07.2025 - 17:29 |