I have just set up a new Apache2 server which is still in development (theflyingrat.com) and because I am a YouTuber, I have a form where people can submit their video ideas to me, except after I fill out the form and submit it, Chrome gives me a 500 error.
This is the html form...
<form action="submit-a-video.php" method="post">
First name:<br>
<div class="right">
If you want to help me make videos, please submit an idea here<br>
I like to entertain you guys but I just have trouble finding ideas!<br>
Although, please keep in mind that I am only a student and as I get older,<br>
I will struggle for time... (Homework of course!)<br>
Thanks for understanding!<br>
-Joey.
</div>
<input type="text" name="firstname" value="" style="height:20px; width: 40%; border-radius:5px;" required>
<br>
Last name:<br>
<input type="text" name="lastname" value="" style="height:20px; width: 40%; border-radius:5px;" required>
<br>E-mail:<br>
<input type="email" name="email" value="" style="height:20px; width: 40%; border-radius:5px;" required>
<br>Your request:<br>
<textarea name="message" required style="width:40%; height:160px; border-radius:5px"></textarea>
<br>
<button type="submit" class="loginbtnsml">Submit</button>
</form>
This is the php processor...
<?php
$file = fopen('requests/requests.txt', 'w');
fwrite($file, "Hey Rat\n" . $_POST["firstname"] . " " . $_POST["lastname"] . " has a video request!\nThe request is:\n\n\" . $_POST["message"] . "\n\nTo ask for more information, please email:" $_POST["email"];
fclose($file);
header("Location: thanks.html");
?>
Thanks in advance for you help, and sorry for your time, Rat