Id like to make a simple login form for a website
<form action="ContactFormHandler.php" method="post">
<table>
<tr>
<td>
Username:
</td>
<td>
<input type="text" id="username" name="username" />
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<input type="text" id="password" name="password" />
</td>
</tr>
<tr>
<td>
Your Email:
</td>
<td>
<input type="text" id="Email" name="Email" />
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" id="submit" value="Submit" />
<input type="reset" id="reset" value="Reset" />
</td>
</tr>
</table>
</form>
</body>
You see where it says contact form handler? I would like the form, and the file handling the form to be the same file. 2 in 1.
how do I include this contact handler in the same file of the contact form?
<?php
$contactName = $_POST["ContactName"];
$contactEmail = $_POST["ContactEmail"];
$contactPassword = $_POST["ContactLeastFavoriteColor"];
$sql_connection = mysql_connect("localhost", "root", "root");
mysql_select_db("MyRadContactForm", $sql_connection);
$sql = "INSERT INTO MyRadContacts (
ContactName,
ContactEmail,
ContactPassword,
ContactDateCreated
)
VALUES (
'$contactName',
'$contactEmail',
'$contactPassword',
NOW()
)";
mysql_query($sql, $sql_connection);
mysql_close($sql_connection);
?>