I've taken the first part of this tutorial: http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/ and edited to suit my needs but when I click Submit on the form it takes me to the php page.
When I click submit I want it to submit the form and the result of the form be emailed to me. I dont know PHP (hence why I was looking at a tutorial), so it is probably a really silly mistake :/
My HTML:
<form action="mail.php" method="POST">
<fieldset>
<h3>Apply</h3>
<div class="alert alert-info">
<p><strong>Recruitment Status:</strong> Open!</p>
</div>
<hr>
<div>
<label>Minecraft Username</label>
<input type="text" placeholder="Very important!" name="username">
<label>Which are you best at?</label>
<select name="BestAt">
<option>Mining</option>
<option>Hunting</option>
<option>Farming</option>
<option>PvP</option>
<option>Raiding</option>
<option>Building</option>
<option>Redstone</option>
<option>Other</option>
</select>
<label>How many hours are you online each day?</label>
<select name="TimeOnline">
<option>Less than 2 hrs</option>
<option>2-4 hrs</option>
<option>4-6 hrs</option>
<option>6-8 hrs</option>
<option>8-10 hrs</option>
<option>More than 10 hrs</option>
</select>
<label>What rank are you?</label>
<select name="rank">
<option>Default</option>
<option>Member</option>
<option>Tier 1</option>
<option>Tier 2</option>
<option>Tier 3</option>
<option>Tier 4</option>
<option>Tier 5</option>
<option>Moderator</option>
<option>Admin/Owner</option>
</select>
<label>What country do you live in?</label>
<input type="text" placeholder="Which Country?" name="country">
<label>How old are you?</label>
<input type="text" placeholder="Optional" name="age">
<label>Previous factions and why you left?</label>
<textarea rows="10" placeholder="One faction per line" name="PreviousFactions"></textarea>
<label>Why do you want to join Kando?</label>
<textarea rows="4" placeholder="Should be atleast 2 sentences" name="WhyYouWantToJoin"></textarea>
<hr>
<p>You may provide us with your forum username rather than email address or vice versa. It is required that you enter atleast one of them.</p>
<label>Email Address (So we can tell you if you've been accepted)</label>
<input type="email" placeholder="Please fill in" name="email">
<label>Forum Username (So we can add you to our private forum)</label>
<input type="text" placeholder="one of these" name="ForumUsername">
<hr>
<label class="checkbox">
<input type="checkbox" value="" name="AgreeToRules">Do you agree to follow our rules?</label>
<hr>
<button class="btn btn-large btn-block btn-primary" type="submit" name="submit" value="Send">Submit Application</button>
</div>
</fieldset>
</form>
My PHP:
<?php $username = $_POST['username'];
$BestAt = $_POST['BestAt'];
$TimeOnline = $_POST['TimeOnline'];
$rank = $_POST['rank'];
$country = $_POST['country'];
$age = $_POST['age'];
$PreviousFactions = $_POST['PreviousFactions'];
$WhyYouWantToJoin = $_POST['WhyYouWantToJoin'];
$email = $_POST['email'];
$ForumUsername = $_POST['ForumUsername'];
$formcontent=" From: $username \n Best At: $BestAt \n Time Online Daily: $TimeOnline \n Rank: $rank \n Country: $country \n Age: $age \n Previous Factions: $PreviousFactions \n Why $username wants to join: $WhyYouWantToJoin \n Email: $email \n Forum Username: $ForumUsername";
$recipient = "email@address.com";
$subject = "Kando Application!";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
Any help is appreciated.