I wanna save on my server a text file and so I'm using the file_put_contents
with some flags. I also have to import a value from an <input type="text" name="loaded">
field that contains some people's names.
<input type="text" name="loaded">
//other html code
<form method="post" action="scriptf.php">
<input type="submit" value="Go!" />
</form>
This script saves on foldera/file.txt only "Lucas Smith (lsmith334) +" but it is missing the ex
(which contains the text in that input).
<?php
$file = 'foldera/file.txt';
$ex = $_POST['loaded'];
$person = "Lucas Smith (lsmith334) + ".$ex;
file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
?>
What am I doing wrong?