_POST not catching submit value
Posted: Fri Jun 28, 2002 3:39 pm
Hey, been working hard some more on my database and stuff, and recently made an page where one can add and delete users from a database. I really liked jason's way of doing it so I copied him. =D Anyway I have a form on the page:
The form is for deleting users. You type in the user, and click the button, it goes through just fine, and the user is deleted. However when you type it in and hit enter, the page reloads, and $_POST['submit'] is not set when the page reloads, resulting in the user deletion to fail.
Also, on the same page is a Add User form, and it works just fine by using enter. (perhaps because it has a type="password" input?)
I thought I might be making a simple html forms error, by not specifying the default send button or something, but I couldn't find anything insightful about it.
If you need the full context for this, I can post it, but it's a rather large script.
So, anyone know how to fix it?
Code: Select all
<form action="<?=$_SERVERї'PHP_SELF']?>" method="post">
<table border="0">
<tr><td colspan="2" align="center"><b>Delete user</b></td></tr>
<tr><td>User name:</td><td><input type="text" name="user" size="15"
maxlength="20"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit"
value="Delete User"></td></tr>
</table>
</form>Also, on the same page is a Add User form, and it works just fine by using enter. (perhaps because it has a type="password" input?)
I thought I might be making a simple html forms error, by not specifying the default send button or something, but I couldn't find anything insightful about it.
If you need the full context for this, I can post it, but it's a rather large script.
So, anyone know how to fix it?