Untitled

mail@pastecode.io avatar
unknown
php
2 years ago
471 B
1
Indexable
Never
<?php
if(isset($_POST['submit'])) {
	//Collect AND Validate Data
	$gender = $_POST['gender'];
	$name = $_POST['name'];
	$email = $_POST['email'];
	$problem = $_POST['problem'];
	$message = $_POST['message'];
	$options = $_POST['options'];
	
	//Collect AND Encode Data
	$array = compact('gender', 'name', 'email', 'problem', 'message', 'options');
	$json = json_encode($array);
	
	//JSON file
	$name = uniqid();
	file_put_contents($name.'.json', $json);
}