Hey I am trying to figure out my problem with my form and where my hangups are in the code. Anyone have any suggestions?
<form method="post" action="tourney.php">
<div class="row">
<div class="col-sm-4">
<input class="form-control" type="text" placeholder="Name" name="tname">
</div>
<div class="col-sm-4">
<input class="form-control" type="text" placeholder="Email" name="temail">
</div>
<div class="col-sm-4">
<input class="form-control" type="text" placeholder="School or Club" name="tclub">
</div>
<br>
<br>
<div class="col-sm-4">
<input class="form-control" type="text" placeholder="Address" name="taddress">
</div>
<div class="col-sm-3">
<input class="form-control" type="text" placeholder="City" name="tcity">
</div>
<div class="col-sm-2">
<input class="form-control" type="text" placeholder="State" name="tstate">
</div>
<div class="col-sm-2">
<input class="form-control" type="text" placeholder="Zip" name="tstate">
</div>
</div>
<br>
<div class="row">
<div class="col-sm-12">
<textarea placeholder="Type your message here..." class="form-control" rows="5"></textarea>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-6">
<select name="type" class="form-control">
<OPTION VALUE="None Selected" SELECTED>Please select one</OPTION>
<OPTION VALUE="Middle School">Middle School Tournamanet</OPTION>
<OPTION VALUE="Elementary">Elementary Tournament</OPTION>
</select>
</div>
<div class="col-sm-6 pull-right">
<input class="btn btn-danger" type="submit" value="Register">
</div>
</div>
</form>
and the PHP to send the email:
<?php
if(isset($_POST['submit'])){
$from = "minguswrestling.com";
$to = "puremeld@gmail.com";
$name = $_POST['tname'];
$email = $_POST['temail'];
$school = $_POST['tclub'];
$address = $_POST['taddress'];
$city = $_POST['tcity'];
$state = $_POST['tstate'];
$zip = $_POST['tzip'];
$type = $_POST['type'];
$message = $_POST['tmessage'];
$subject = "Tourney Signup!";
$body = "From: $from \n Name: $name \n Email: $email \n School: $school\n Address: $address\n City: $city State: $state Zip: $zip\n Event: $type\n Message: $message";
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
'<h2>Thank You!</h2>';
header("Location: index.html");
} else {
echo '<p>Oops! An error occurred. Try sending your message again. </p>';
}
}
}
?>
Any help would be appreciated. I am using bootstrap for my build, thank you.