Note that there are some explanatory texts on larger screens.

plurals
  1. POClicking on Sumbit takes me to php page
    text
    copied!<p>I've taken the first part of this tutorial: <a href="http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/" rel="nofollow">http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/</a> and edited to suit my needs but when I click Submit on the form it takes me to the php page. </p> <p>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 :/</p> <p>My HTML:</p> <pre><code>&lt;form action="mail.php" method="POST"&gt; &lt;fieldset&gt; &lt;h3&gt;Apply&lt;/h3&gt; &lt;div class="alert alert-info"&gt; &lt;p&gt;&lt;strong&gt;Recruitment Status:&lt;/strong&gt; Open!&lt;/p&gt; &lt;/div&gt; &lt;hr&gt; &lt;div&gt; &lt;label&gt;Minecraft Username&lt;/label&gt; &lt;input type="text" placeholder="Very important!" name="username"&gt; &lt;label&gt;Which are you best at?&lt;/label&gt; &lt;select name="BestAt"&gt; &lt;option&gt;Mining&lt;/option&gt; &lt;option&gt;Hunting&lt;/option&gt; &lt;option&gt;Farming&lt;/option&gt; &lt;option&gt;PvP&lt;/option&gt; &lt;option&gt;Raiding&lt;/option&gt; &lt;option&gt;Building&lt;/option&gt; &lt;option&gt;Redstone&lt;/option&gt; &lt;option&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;label&gt;How many hours are you online each day?&lt;/label&gt; &lt;select name="TimeOnline"&gt; &lt;option&gt;Less than 2 hrs&lt;/option&gt; &lt;option&gt;2-4 hrs&lt;/option&gt; &lt;option&gt;4-6 hrs&lt;/option&gt; &lt;option&gt;6-8 hrs&lt;/option&gt; &lt;option&gt;8-10 hrs&lt;/option&gt; &lt;option&gt;More than 10 hrs&lt;/option&gt; &lt;/select&gt; &lt;label&gt;What rank are you?&lt;/label&gt; &lt;select name="rank"&gt; &lt;option&gt;Default&lt;/option&gt; &lt;option&gt;Member&lt;/option&gt; &lt;option&gt;Tier 1&lt;/option&gt; &lt;option&gt;Tier 2&lt;/option&gt; &lt;option&gt;Tier 3&lt;/option&gt; &lt;option&gt;Tier 4&lt;/option&gt; &lt;option&gt;Tier 5&lt;/option&gt; &lt;option&gt;Moderator&lt;/option&gt; &lt;option&gt;Admin/Owner&lt;/option&gt; &lt;/select&gt; &lt;label&gt;What country do you live in?&lt;/label&gt; &lt;input type="text" placeholder="Which Country?" name="country"&gt; &lt;label&gt;How old are you?&lt;/label&gt; &lt;input type="text" placeholder="Optional" name="age"&gt; &lt;label&gt;Previous factions and why you left?&lt;/label&gt; &lt;textarea rows="10" placeholder="One faction per line" name="PreviousFactions"&gt;&lt;/textarea&gt; &lt;label&gt;Why do you want to join Kando?&lt;/label&gt; &lt;textarea rows="4" placeholder="Should be atleast 2 sentences" name="WhyYouWantToJoin"&gt;&lt;/textarea&gt; &lt;hr&gt; &lt;p&gt;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.&lt;/p&gt; &lt;label&gt;Email Address (So we can tell you if you've been accepted)&lt;/label&gt; &lt;input type="email" placeholder="Please fill in" name="email"&gt; &lt;label&gt;Forum Username (So we can add you to our private forum)&lt;/label&gt; &lt;input type="text" placeholder="one of these" name="ForumUsername"&gt; &lt;hr&gt; &lt;label class="checkbox"&gt; &lt;input type="checkbox" value="" name="AgreeToRules"&gt;Do you agree to follow our rules?&lt;/label&gt; &lt;hr&gt; &lt;button class="btn btn-large btn-block btn-primary" type="submit" name="submit" value="Send"&gt;Submit Application&lt;/button&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>My PHP:</p> <pre><code>&lt;?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!"; ?&gt; </code></pre> <p>Any help is appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload