Re: How 2 pass a hidden field string in html form to a php script
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Sun, 05 Apr 2009 12:28:03 +0200
Tru7nk wrote:
J.O. Aho:
You should make it better, resend the user to the form, telling why.
Get you point, but actually I am using that one to prevent that someone
does execute the script remotely.
This might prevent that an empy form being sent to the hard-coded
recipient of the form.
If you want to prevent the user from execute the script remotely, I think the
best is to use session, as that is a lot harder to fake than a hidden field,
which will most likely be known by the one who wants to run it remotely, and
the less randomness in your hidden field the easier it will be to make remote
submissions.
Don't think that the session will be a fool proof protection, you can still
fetch a session, rebuild the form data and submit and it would still look as
if it was the original form you sent.
You can add a 'HTTP_REFERER' check, but that can be both faked and a
legitimate user who has this feature disable in the browser.
But you know there are tons of microsoft users around the world, you never
know what they may do when they try to fill a form, if not the default browser
don't mess things up, the user will enter a text string in a field dedicated
for integers, so it's always good to throw the user back and tell what stupid
thing they did. Taking care of the hack attempts in the same way will be good,
as you have a good way to test that your protection do work.
--
//Aho
.
- Follow-Ups:
- References:
- How 2 pass a hidden field string in html form to a php script
- From: Tru7nk
- Re: How 2 pass a hidden field string in html form to a php script
- From: Tru7nk
- Re: How 2 pass a hidden field string in html form to a php script
- From: Michael Fesser
- Re: How 2 pass a hidden field string in html form to a php script
- From: Tru7nk
- Re: How 2 pass a hidden field string in html form to a php script
- From: J.O. Aho
- Re: How 2 pass a hidden field string in html form to a php script
- From: Tru7nk
- How 2 pass a hidden field string in html form to a php script
- Prev by Date: Re: How 2 pass a hidden field string in html form to a php script
- Next by Date: Re: How 2 pass a hidden field string in html form to a php script
- Previous by thread: Re: How 2 pass a hidden field string in html form to a php script
- Next by thread: Re: How 2 pass a hidden field string in html form to a php script
- Index(es):
Relevant Pages
|