I worked out a form to fill out on a simple php site, how can I set up a script to put that information in a html/php file and finally save it on the server (file name should be the same name as the $name) $name = $email = $friendcode = "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$name = test_input($_POST["name"]);
$email = test_input($_POST["email"]);
$friendcode = test_input($_POST["friendcode"]);
}
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
Name: <input type="text" name="name"><?php echo $nameErr;?>
<br><br>
E-mail: <input type="text" name="email"><?php echo $emailErr;?>
<br><br>
Friendcode: <input type="text" name="friendcode"><?php echo $friendcodeErr;?>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>