![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 401 Pomógł: 0 Dołączył: 18.04.2003 Skąd: Trójmiasto Ostrzeżenie: (0%) ![]() ![]() |
witam,
mam taki kodzik : [php:1:2c968978b3]<? $sciezka = "/home/www/plik.txt"; ?> <pre> <?php if( empty( $_POST['file'] ) ) { ?> <form method="post" > <input type="hidden" name="file" value="<?=$sciezka; ?>"> <input type="submit" value="Edytuj dane" /> </form> <?php } else { $strFile = $_POST['file']; if( !file_exists( $strFile ) ) { die( 'Plik nie istnieje!' ); } if( empty( $_POST['contents'] ) ) { $strContents = file_get_contents( $strFile ); $strFile = stripslashes( $strFile ); ?> <form method="post"> Edycja pliku <?php echo $strFile ?>:<br /> <textarea name="contents" cols="100" rows="25"><?php echo $strContents ?></textarea> <input type="hidden" name="file" value="<?php echo $strFile ?>" /> <input type="submit" value="Zapisz zmiany" /> </form> <?php } else { $strContents = stripslashes( $_POST['contents'] ); $fp = fopen( $strFile, 'w' ); if( $fp ) { flock( $fp, 2 ); fputs( $fp, $strContents ); flock( $fp, 3); fclose( $fp ); echo 'Zmiany zostały zapisane!'; echo "<br><br><a href=# onclick=java script:window.close()><input type=button value=Zamknij></a>"; } else { echo 'Otwarcie pliku do zapisu nie powiodło sie!'; } } } ?> </pre>[/php:1:2c968978b3] no i cos on nie chce zabardzo dzialac na linuxie.. tzn. u mnie na lokalu dziala bardzo ladnie (thx Cudi) ale na linuxie juz sie wykrzacza ![]() ![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 27.06.2025 - 10:47 |