I have a website and i'm making a content management system for the website. I need to be upload a .txt file and then be able to edit that file inside the website. so far I have this:
<?php
$myFile = fopen("welcome-content.txt", 'r');
while (($buffer = fgets($myFile)) !== false) {
echo "<p>";
echo $buffer;
echo "</p>";
}
fclose($myFile);
?>
This is able to upload the file, but I have to have the file name as "welcome-content.txt", I want to be able too select a file from the File Explorer, upload it, and then be able to edit it. Am I right in thinking I need a HTML Form in order to select the file? But as far as anything else I'm not sure where to go from there.
Any tips?