![ישן](https://static.fresh.co.il/images/vBulletin/statusicon/post_old.gif)
29-08-2006, 13:54
|
|
|
חבר מתאריך: 05.02.06
הודעות: 194
|
|
תנסה ככה:
קוד PHP:
<?php if (isset($_GET['up'])) { if (!$fp = fopen($_GET['file'], "w")) die ("Eror with file open"); if (fwrite($fp, $_GET['editfile']) == FALSE) die ("ERROR: cannot write into file"); else die ("The file is now change"); } if (!file_exists($_GET['file'])) die ("the file is not exists"); if (filesize($_GET['file']) == 0) die ("the file is empty"); if (!$fp = fopen($_GET['file'], "rb")) die ("Eror with file open"); $contents = ''; while (!feof($fp)) $contents .= fread($fp, filesize($_GET['file'])); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>edit file</title> </head> <body> <form action="pty2.php" method="GET" enctype="application/x-www-form-urlencoded"> <textarea cols="60" rows="30" name="editfile"><?=$contents ?></textarea> <?php fclose($fp); ?> <input type="hidden" value="<?=$_GET['file'] ?>" name="file" /> <input type="submit" value="update" name="up" /> </form> </body> </html>
|