i've looked and looked and i see no reason why the 2 frames arent displaying their sources using the the default action in my script(webeditor.php.) after running the script, i clicked view source and it shows that in fact the frames were created. and another wierd thing is that i can copy the frames' sources, paste them directly into the address bar, and they come up just fine! (the variable $dir is defined in common.inc)im pasting webeditor.php here, thanks for any replys!
webeditor.php is shown here:
<?php
include "./common.inc";
include "./editor.inc";
include "./navigator.inc";
function frame_page() {
global $PHP_SELF, $dir;
?>
<HEAD><TITLE>Welcome to Web Text Editor!</TITLE></HEAD>
<FRAMESET COLS="200,*">
<FRAME NAME="menu"
SRC="<?php echo "$PHP_SELF?action=dir_page&dir=$dir"; ?>">
<FRAME NAME="main"
SRC="<?php echo "$PHP_SELF?action=editor_page&dir=$dir"; ?>">
<NOFRAMES>
<BODY TOPMARGIN="0" LEFTMARGIN="0">
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>
</NOFRAMES>
</FRAMESET>
<?php
}
function upload_file_form() {
global $PHP_SELF, $dir;
?>
<FORM METHOD="POST" ENCTYPE="MULTIPART/FORM-DATA"
ACTION="<?php echo $PHP_SELF ?>" TARGET="menu">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="upload_file">
<INPUT TYPE="HIDDEN" NAME="dir" VALUE="<? echo $dir ?>">
Local Filename <INPUT TYPE="FILE" NAME="userfile">
Uploaded Filename<INPUT TYPE="TEXT" NAME="filename" LENGTH="20">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="upload">
</FORM>
<?php
}
function upload_file() {
global $userfile, $userfile_name, $userfile_size, $userfile_type,
$filename, $default_dir, $dir, $PHP_SELF, $WINDIR;
$def_length=strlen($default_dir);
if(!empty($dir)) $dir_test=substr($dir, 0, $def_length);
if(empty($dir) || ($dir_test!=$default_dir)) {
error_message("$dir/$filename is illegal directory.");
}
if(!isset($WINDIR)) $userfile = str_replace("\\","\", $userfile);
if(empty($filename)) $filename = basename($userfile_name);
if($userfile_size <= 0) {
error_message("$filename is empty.");
}
if(file_exists("$dir/$filename")) {
error_message("$filename already exists.");
}
if(!@copy($userfile, "$dir/$filename")) {
error_message("Can't copy $userfile_name to $filename.");
}
if(!isset($WINDIR) && !@unlink($userfile)) {
error_message("Can't delete $userfile_name.");
}
html_header();
$file_info_array = file_info("$dir/$filename");
if($file_info_array["filetype"] == 'text')
echo "<SCRIPT>parent.main.location.href='$PHP_SELF?
action=editor_page&dir=$dir&filename=$filename';
</SCRIPT>";
dir_page();
html_footer();
}
$def_length=strlen($default_dir);
if(!empty($dir)) $dir_test=substr($dir, 0, $def_length);
if(empty($dir) || ($dir_test!=$default_dir)) {
$dir = $default_dir;
}
if($filename == basename($PHP_SELF)) error_message("You can't edit me!");
switch ($action) {
case "editor_page":
html_header();
upload_file_form();
editor_page();
html_footer();
break;
case "dir_page":
html_header();
dir_page();
html_footer();
break;
case "make_dir":
make_dir();
break;
case "delete_dir":
delete_dir();
break;
case "delete_file":
delete_file();
break;
case "save_file":
save_file();
break;
case "upload_file":
upload_file();
break;
default:
frame_page();
break;
}
?>