The editor is in a frame call "pageedit".Passing v
Posted: Tue May 02, 2006 5:04 pm
feyd | Please use
Here is the code for the editor :
and in an textarea is :
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Good day to you all !!!
I've find an directory lister and from it i need when the user click on a file that it pass the value to another page, this one in a frame, witch would be a simple php file editor so that he/she could edit the selected file and save it.
Here is thecode use for the directory lister :Code: Select all
function directory($result) {
$handle=opendir(".");
while ($file = readdir($handle)) {
if ($file == "." || $file == "..") { } else { print "<a href=$file>$file</a><br>\n"; }
}
closedir($handle);
return $result;
}
?>
<b>Select the file you want to go to:</b>
<p>
<?
echo directory($result);
?>Code: Select all
<?php
$file = "index.html";
if(isset($_POST['text']))
{
if(get_magic_quotes_gpc())
{
$_POST['text'] = stripslashes($_POST['text']);
}
$handle = fopen($file, 'w') or die("Unable to open file for writing");
fwrite($handle, $_POST['text']);
fclose($handle);
}
$text = "";
if(is_readable($file))
{
$text = file_get_contents($file);
}
?>Code: Select all
<?php echo $text; ?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]