| Author |
Capture the requesting URL
|
|
| Stephen Preston 2006-07-27, 6:56 pm |
| Is it possible to capture a visitors URL?
I have a Form button on a page which when clicked opens a demo page. Within
the form is a hidden field which adds the date/time of the button click into
a table in a MySQL database. Is it possible to capture the URL of the human
who clicks the Form button and if so what are the mechanics.
Will a robot be able to activate the form and thus give a non 'human' entry
in to the table?
Thanks
Stephen
| |
| ZeldorBlat 2006-07-27, 6:56 pm |
|
Stephen Preston wrote:
> Is it possible to capture a visitors URL?
>
> I have a Form button on a page which when clicked opens a demo page. Within
> the form is a hidden field which adds the date/time of the button click into
> a table in a MySQL database. Is it possible to capture the URL of the human
> who clicks the Form button and if so what are the mechanics.
>
> Will a robot be able to activate the form and thus give a non 'human' entry
> in to the table?
>
>
> Thanks
> Stephen
What do you mean by "the URL of the human who clicks the form button?"
The URL of the page that contains the form?
| |
|
| Stephen Preston wrote:
> Is it possible to capture a visitors URL?
>
> I have a Form button on a page which when clicked opens a demo page.
> Within the form is a hidden field which adds the date/time of the
> button click into a table in a MySQL database. Is it possible to
> capture the URL of the human who clicks the Form button and if so
> what are the mechanics.
>
> Will a robot be able to activate the form and thus give a non 'human'
> entry in to the table?
You could check for $_SERVER['HTTP_REFERER'], but that's not very
trustworthy. Another method is to temporarily store a visitors IP in a table
when loading the form, and checking wether your own form was loaded on a
submit. That could still be faked though. Captcha methods are a drag in this
sort of thing, but the only way you can be reasonably sure.
What are your exact reasons for wanting this? Maybe there is another way.
Grtz,
--
Rik Wasmus
| |
| Stephen Preston 2006-07-28, 6:57 pm |
| Sorry I did mean IP and not URL
The reason was just to see if the requests were coming from the same ip or
if it was different.
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:ceac$44c94a48$8259c69c$8108@news1.tudelft.nl...
> Stephen Preston wrote:
>
> You could check for $_SERVER['HTTP_REFERER'], but that's not very
> trustworthy. Another method is to temporarily store a visitors IP in a
> table
> when loading the form, and checking wether your own form was loaded on a
> submit. That could still be faked though. Captcha methods are a drag in
> this
> sort of thing, but the only way you can be reasonably sure.
>
> What are your exact reasons for wanting this? Maybe there is another way.
>
> Grtz,
> --
> Rik Wasmus
>
>
| |
|
| Stephen Preston wrote:
> Sorry I did mean IP and not URL
>
> The reason was just to see if the requests were coming from the same
> ip or if it was different.
Well that's $_SERVER['REMOTE_ADDR']. Store in a DB or session et voila.
Grtz,
--
Rik Wasmus
|
|
|
|