Hi,
let me explain what i am trying to do:
i have the following code in file_mgr.php:
switch ($mode)
{
case 'f_edit':
include("includes/file_edit.php");
break;
case 'edit':
if (isset($file))
{
$res = WriteFile("$dir/$file", $theFile);
}
include("includes/file_edit.php");
break;
}
$dir contains a file url such as c:/program files/apache/...
clicking on a link somewhere on the page calls file_mgr.php?mode=f_edit&dir=c:/program files/apache group/apache/htdocs/web/files/
which changes $dir to a different value and sets $mode to 'f_edit' and executes this case.
file_edit.php contains the following form:
<form name=edit action=<?php echo "$PHP_SELF?mode=edit"; ?> method=post>
<textarea name=theFile rows=15 cols=75 wrap=virtual><?php
if (isset($file)){
readfile("$dir$file");
} ?></textarea>
<br>File name: <input type=text name=file size=25 value=<?php echo $file; ?>>
<input type=submit value="Save File">
when this form is submitted $mode is set to 'edit' and the body of the case is executed, but with the old value of $dir.
I want the case to be executed with the new value of $dir.
Why is this?
Its been bugging me all day!
PLEASE HELP
🙂