On Tue, 2004-08-24 at 15:22, Chris Devers wrote:
> On Tue, 24 Aug 2004, Joe Echavarria wrote:
> 
> >  After a user fill out a form and submit it a perl
> > script takes the user to a download page of my
> > website.  how can i prevent a user from directly
> > access the download page using the web browser.., for
> > example http://www.mydomain.com/download_page.html, i
> > only want the user to able to download the file if
> > he/she fill out and submit the form.
> >
> >  Any help on how to do that ?
> 
> Users can *always* get around such barriers, so don't get your hopes up 
> that it will be perfect.
> 
> That said, you can make it harder, but not impossible, to get to the 
> download page without filling out the form first.
> 
> The obvious way I can think of to do this is to make the download page a 
> script that checks to see that:
> 
>    * mandatory form fields are defined as input for the download script
>    * the referring page is your original form (this one is probably less
>      important than the previous criteria, if you think about it)
> 
> If these are not verified, send the user back to the form with a note 
> saying that fields X, Y, and Z still need to be filled out.

This gave me an idea... one could have a hidden field in that form :-)

This way, you could know if the user came from a form with that field or
not (note: "if the user came from a form with that field", not if the
user came from that form). Then you can point him to the right address
:-)

> If these are verified -- or, more to the point, if the form fields you 
> need are verified -- then that's about as good as forcing the user to 
> have visited the first page to begin with.
> 
> 
> -- 
> Chris Devers
-- 
José Alves de Castro <[EMAIL PROTECTED]>
  http://natura.di.uminho.pt/~jac

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to