<?php
if (isset($_POST['email'])) {
$email = mysql_real_escape_string($_POST['email']);
$password = mysql_real_escape_string($_POST['password']);
mysql_query("INSERT INTO accounts (email, password) VALUES ('$email', '$password')");
}
?>
<h1>Create Account</h1>
<form action="" method="post">
<table cellspacing="3">
<tr>
<td valign="top">E-mail address:</td>
<td><input type="text" name="email" size="28"></td>
</tr>
<tr>
<td valign="top">Password:</td>
<td><input type="text" name="password" size="28"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>
How can I prevent people from just entering spaces and insert empty entries? :/ And do you see any other potential threats?
Thanks. /Newbie