I want to retrieve NAME OF FORM from php when i am submitting a form. Can i find the NAME OF FORM by PHP?
Or include a hidden field.
MvanGeest
2010-06-15 16:22:50
A:
Short answer: No.
Long answer: If your PHP code is inline, I don't see why you couldn't use the form name in your PHP code. However, if your PHP code resides in a separate script and you're submitting your form to that script, then you need to explicitly pass in the name of the form through an input element (a hidden input element will work).
Vivin Paliath
2010-06-15 16:22:37
I have a form with no captcha and this is submitting by POST method.I am fearing for Spamming. User can spam my database by ajax. How will i protect it by Spammers.ANy idea.. thanks in advance.
Ajay
2010-06-15 16:26:52
You will need to use a captcha. A determined attacker can easily go through your code and see that you're sending in the form name in a hidden field.
Vivin Paliath
2010-06-15 16:33:05
+1
A:
No, only successful controls are submitted. The name of the form is just for scripting. But you could use a hidden input to set a name for the form:
<form action="…">
<input type="hidden" name="form-name" value="foobar">
</form>
Gumbo
2010-06-15 16:22:40
I have a form with no captcha and this is submitting by POST method.I am fearing for Spamming. User can spam my database by ajax. How will i protect it by Spammers.ANy idea.. thanks in advance.
Ajay
2010-06-15 16:29:25
@Ajay: That’s a completely different type of question. So you wanted the form’s name to protect yourself against spam?
Gumbo
2010-06-15 16:38:15
yes exactly.. i want to protect it by form name retrieving so spammers can't get guess and send it by ajax.
Ajay
2010-06-15 16:43:24
@Ajay: Knowing the form’s name does not protect you against spammers. They could easily obtain the form’s name and send it along with the request.
Gumbo
2010-06-15 16:45:57