Form doesn't work when ENTER is hit.
Posted: Sat Mar 26, 2005 10:43 am
I have a form which deletes from the database whena password is entered. However when i "click" the button with my mouse, it works. However when I hit "ENTER" the form doesn't work and it just seems to refresh the page.
Heres my form code piece:
... and heres some more code from the top of the page:
Could you tell me why this happens?
Heres my form code piece:
Code: Select all
*snip*
<tr>
<td class="e;trow1"e; align="e;left"e; colspan="e;2"e;><form action="e;"e; method="e;POST"e; name="e;deleteab"e;>Are you sure you want to delete this? If so, enter your password below and hit the "e;Confirm Delete"e; button.<br><font color="e;#FF0000"e;><b>WARNING:</b> This action cannot be reversed!</font><br>Enter Your Password:<br><input type="e;password"e; name="e;g_del_password"e; size="e;50"e;><br><input type="e;submit"e; name="e;deleteab"e; value="e;Confirm Delete"e;></form></td>
</tr>
*snip*Code: Select all
<?php
if(isset( $deletegb ))
{
$gbdelpass82 = $_POST['g_del_password'];
$gbdelpass82 = md5($gbdelpass82);
$conn = mysql_connect("localhost","***","***");
mysql_select_db("***",$conn) or die(mysql_error());
$sql = "SELECT * FROM users WHERE password = '$gbdelpass82' AND uid = $gad[uid]";
$result = mysql_query($sql,$conn) or die(mysql_error());
while ($r = mysql_fetch_array($result)) {
$g_password_d = $r['password'];
}
if ($gbdelpass82 == $g_password_d) {
*snips out the delete thingy*
echo "<a href=\"./ser.php\">Done</a>";
} else {
echo "Problem";
}
exit;
}
?>