I've searched and searched I cannot find an answer to this I've made a form HERE It's very basic. Somehow it's not submitting the final data. the code is
<form class="form" action="submit.php" method="post">
<table>
<tr>
<td>Team Name: </td>
<td><input type="text" name="team"></td>
</tr>
<tr>
<td>Captains xbox tag: </td>
<td><input type="text" name="cap"></td>
<tr>
<td>Captains E-mail:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>Team Mates: </td>
<td><TEXTAREA name="teammates" rows="6" cols="50">
Please place each team member on a new line
</TEXTAREA><br></td>
</tr>
<tr>
<td>Sub team mates: </td>
<td><TEXTAREA name="subs" rows="2" cols="50"></TEXTAREA></td>
</tr>
</table>
<p><input type="submit"></p>
</form>
That's the form
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "dbname";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO tournament1 (team, teammates, cap, email, subs)
VALUES ('$_POST[team]','$_POST[cap]','$_POST[email]','$_POST[teammates]','$_POST[subs]')";
if ($conn->query($sql) === TRUE) {
echo "Your team has been submitted Thankyou. You will be redirected back to the tournaments page Shortly";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
What am I doing wrong? It will connect and do something because the ID fills because of its autoincremented. everything else gets lost. Thanks in advance guys Kyle