I have got LAMP server installed on my Ubuntu 16.04 machine.
I have created a basic HTML form that is required to accept the first and the last name of the user and save the data in a text file.
Now the issue is that when the form data is entered and SUBMIT button is hit, then the page redirections take place as defined by the script but the file in which I am supposed to store the data is not created.
Here is the code that I have written
<html>
<head>
<title>Text Input Control</title>
</head>
<body>
<form action="confirm_send.php", method="post">
First name: <input type="text" name="first_name" />
<br>
Last name: <input type="text" name="last_name" />
<input type="submit" value="submit" name="submit">
</form>
</body>
</html>
<?php
$Fname = $_POST["first_name"];
$Lname = $_POST["last_name"];
$fp = fopen('data.csv', 'a');
fwrite($fp, $Fname);
fclose($fp);
?>
the file data.csv is not created once SUBMIT is done. I also checked the HOME directory it was not found. What’s the catch?