File "upload_files_base01.php"

Full Path: /home/analogde/www/DEV/30_09_2024/upload_files_base01.php
File size: 1.36 KB
MIME-type: text/x-php
Charset: utf-8

<?php


	$vehicle= $_POST['vehicle'];

	$identifiant_file = uniqid('user_', true);

	$handle = fopen($identifiant_file, "w") or die("Unable to open file!");
	//$txt = "John Doe\n";
	//fwrite($handle, $txt);
	//$txt = "Jane Doe\n";
	//fwrite($handle, $txt);
	//fclose($myfile);


	//$cars = array("Volvo","BMW","Toyota");
	
	for ($x = 0; $x < count($vehicle); $x++) 
	{
		//fwrite($handle, $d ."\n");
		//foreach($vehicle as $d)
		fwrite($handle, $vehicle[$x] ."\n");
	}
	
	fclose($handle);
	
	echo $identifiant_file;
	

		
	/*$data = json_decode(stripslashes($_POST['liste']));

	
	
	foreach($data as $d)
	{
		//$pipo += $pipo ." " .$d 
		
	}

	fclose($myfile);*/

	//echo "----> " .$pipo; 

	/*$jsonData = $_POST['liste']; 
	$array_aliments = json_decode($jsonData); 

	$myfile = fopen("trace.txt", "w") or die("Unable to open file!");

	foreach ($array_aliments as $value) 
	{
		fwrite($handle, $value ."\n");
	}
	fclose($myfile);*/

/*
	if(!empty($_FILES['file']['name']))
	{
		
		$myfile = fopen("trace.txt", "w") or die("Unable to open file!");
		
		//foreach($_FILES['file']['name'] as $key=>$val)
		//{ 
			$fileName = basename($_FILES['file']['name']);  
			//$targetFilePath = $uploadDir.$fileName;  
			
			fwrite($handle, $fileName ."\n");
		//}
		
		
		//$txt = "John Doe\n";
		//fwrite($myfile, $txt);
		//$txt = "Jane Doe\n";
		//fwrite($myfile, $txt);
		fclose($myfile);
	}
*/	
?>