I want to make a little game for my friends. This is the part where they have to enter their names and then click the submit button. Their names will then be written in a log file and then redirected to another page. But I can't seem to make it work. Either it won't write their names in the log file or it won't redirect. It probably a simple solution but I can't seem to figure it out. How do I sent data to a log file and redirect to another page with the same button?
<form method='POST'>
<textarea name='info'></textarea>
<input type=submit>
</form>
<?php
$name = $_POST['info'];
file_put_contents("log/" . "$_SERVER[REMOTE_ADDR]" . ".log", $name . PHP_EOL, FILE_APPEND);
?>