I’m trying to save some variables in .csv file which is online, but it doesn’t work. I tried to create the file by myself and run the code and to let the code creates the file when it runs. But, in both cases it doesn’t work
<html>
<body>
<?php
$name = $_POST['name'];
$gender = $_POST['gender'];
$nationality = $_POST['nationality'];
if($nationality == "Other")
$nationality = $_POST['otherNationality'];
$job = $_POST['job'];
$country = $_POST['country'];
$years = $_POST['years'];
$fh = fopen("results.csv", "a");
$personalInfo = $name. ", " . $gender . ", " . $nationality . ", " . $job . ", " . $country . ", " . $years;
if($fh){
fwrite($fh, $personalInfo);
fclose($fh);
}
?>
As I said it was a permission issue and since you have no access to the CLI you can use the following
I hope this help