On my website i got a form looks like this on index.html:
<form id="demo" action='submit.php' method='post' enctype='text/plain'>
link: <input type='text' name='web'></br>
<input type='submit' value='submit'>
</form>
And then in the submit.php i got:
<?php
$fp=fopen('sub.txt','a');
fwrite($fp,addslashes($web));
fclose($fp);
header('location: thanks.html');
exit();
?>
But when i press submit the result in sub.php is beeing
/n
But it should be
example.com/n
What is wrong in the php code.
I want the link submited in the form printed in the file sub.txt and then the person be redirected to a thank you page.