Re: Textarea to road a text file
| From: | Jean Lee | Date: | Sat, 31 Oct 2009 06:14:52 +0000 |
| Subject: | Re: Textarea to road a text file | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299542@lists.php.net to get a copy of this message | ||
Yes, I just want to edit a file in the textarea!
thank you.
""Jay Blanchard"" <jblanchard@pocket.com> wrote in message
news:31454D514FF9A949B1FDFE294D5D1D8008017D@ygex01wal.onecall.local...
[snip]
<html><head><title>.....
<body>..............
<?php
$handle = fopen("./menu.php", "r");
$contents = "";
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle);
$contents = $contents . $buffer;
}
fclose($handle);
}
echo "<textarea cols=80 rows=30>" . $contents . "</textarea>";
?>
</body>
</html>
[/snip]
Try http://us3.php.net/manual/en/function.file-get-contents.php
<?php
$contents = file_get_contents('./menu.php');
echo "<textarea cols=80 rows=30>" . $contents . "</textarea>";
?>
I am unsure what you want to do here, display the menu in the textarea?
Or do you want to be able to edit menu.php in the textarea?