All pastes #294758 Raw Edit

Untitled

public text v1 · immutable
#294758 ·published 2006-12-28 20:10 UTC
rendered paste body
//SCRIPT THAT CALLS FILE

<?

  /**
	* filename.php
	*
	* Main file for CMX-Networks
	*
	* @author     Phillip Tanner <ptanner@cmx-networks.net>
	* @link       http://www.cmx-networks.net
	* @since      March 10, 2006
	* @version    $Revision: 1.0 $
	* @package    CodeName : Source
	* 
  	*/

$filename = "../../../docs/TODO";
if($_POST['Submit'])
{
        $open = fopen("$filename","w+");
        $text = $_POST['update'];
        $text = str_replace("\\", "", $text);
        fwrite($open, $text);
        fclose($open);
        echo "File updated.'$filename'.<br />";
 
}
else
{
        $file = file("$filename");
        echo "<form action=\"".$PHP_SELF."\" method=\"post\">";
        echo "<pre><textarea Name=\"update\" cols=\"100\" rows=\"40\">";
        foreach($file as $text)
                echo $text;
        echo "</textarea></pre>\n";
        echo "<input name=\"Submit\" type=\"submit\" value=\"Save\" /></form>";
}
 
?>