
21-11-2005, 21:15
|
 |
|
|
חבר מתאריך: 02.10.05
הודעות: 2,355
|
|
|
בעיה ב- fread...
אני עושה עכשיו דף שדרכו אפשר לערוך קבצים...
הכל בסדר ויפה חוץ מזה שבאמצע שום מקום הסקריפט הפסיק לעבוד, עשיתי refresh ויוצא לי דף לבן..
אני משתגע מזה! אני ממש לא מבין מה הבעיה! הנה הקוד:
קוד PHP:
<?php if (!file_exists($_GET['file'])) { die ("the file is not exists"); } $fp = fopen($_GET['file'], "rb"); if (!$fp) { 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> <meta http-equiv="generator" content="PHP Designer 2005" /> </head>
<body bgcolor="#FFFFFF"> <form action="page_control_index.php" method="GET" enctype="application/x-www-form-urlencoded"> <textarea cols="60" rows="30" wrap="OFF" name"editfile"> <?php echo "$contents"; fclose($fp); ?> </textarea> </form> </body> </html>
|