File "sauve_fichier.php"

Full Path: /home/analogde/www/copy/sauve_fichier.php
File size: 779 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
//error_reporting(E_ALL);
//var_dump($_SERVER);

	//$post_data = $_POST['data'];


	//echo $_POST['data'] ."  " .$_POST['blase'];

	


	

	

	chdir("backup");
	
	if (!empty($_POST['data'])) 
	{
		/*$dir = "backup"; 
		$file = uniqid().getmypid();
		//$filename = $dir.$file.'.txt';
		$handle = fopen($filename, "w");
		
		$val = $_POST['data'];
		
		fwrite($handle, $val);
		fclose($handle);
		
		//echo $post_data ." " .$post_bis; 
		
		echo $_POST['filename'] ." enregistrer";*/
		
		
		$handle = fopen($_POST['filename'], "w") or die("Unable to open file!");
		$txt = "John Doe\n";
		fwrite($handle, $_POST['data']);
		fclose($handle);
		
		
		echo ">>>> " .$_POST['filename'] ." " .$_POST['data'];
		
		//echo "Bravo";
	}
?>