|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
$_POST['submit'] problem
Hi.. I'm pretty new to this..
I am trying to make a login script, where I check if the login form has been submitted by using if ($_POST['submit'])... For some reason, it always turns out with $_POST['submit'] not being set... If I try to check for the username text field being set, like this: $_POST['username'], it works fine... Any ideas why?? |
|
#2
|
||||
|
||||
|
Are you actually naming your submit field? I know that I often neglect to set it. And, well, why not just check for $_POST['username'] or $_POST.
|
|
#3
|
|||
|
|||
|
Yes.. I have set the submitnutton name to "submit".. I have also checked for any spelling mistakes a thousand times...
I could use $_POST['username'].. It just bothers me that it doesn't work, when I don't know why... Besides, I also use the same method in my register script... I use if $_POST['submit'] where I check for any blank input fields and other errors, and display the error messages.. and else to display the reg.form... If I use for example $_POST['username'], and the user forgets to fill in that field before hitting the submit button, then the reg.form will be displyed without displaying the error messages... |
|
#4
|
||||
|
||||
|
Just use $_POST, then. I think that array should exist on post, though the values in the individual fields may be blank. Also, have you considered giving your submit button a different name? I doubt that's the problem, but it might be worth a shot. Is your submit button a button or an image? If it's an image, you'll need to use submit.x or submit.y to test for the button.
|
|
#5
|
|||
|
|||
|
Yes.. The submit button is an image.. How do I use submit.x or .y??
something like this? if ($_POST['submit.x']) Thanx |
|
#6
|
|||
|
|||
|
I tried using just $_POST like you said, and it worked perfectly..
Thanx a lot.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > $_POST['submit'] problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|