
how to only allow calls to perl or cgi script from certain page
On Jan 8, Mike inscribed on the eternal scroll:
Quote:
> I need to be able to restrict users from calling my search script from their
> site or another site, or typeing whatever they want in the URL.
Wrong thinking. There is absolutely no way you can reliably stop them
from making mischievous requests in the first place. There is no
shortcut: you need to fully validate their request when it reaches the
server.
Quote:
> I know I can create a list of words to prevent the searching but I would
> rather restrict the search to only being called from a certain page, and not
> allow them to enter any other search strings in the URL.
> Can anybody help me?
Not until you recognise that you're wasting your time with that
approach.
Be sure to carefully read and understand Stein's WWW CGI Security FAQ.
Writing CGI scripts is a serious enterprise - many security exposures
(some of which have been far from trivial) have been created by script
authors who failed to take the task seriously.
And next time you have a specifically CGI question, I reckon the
regulars here would prefer you raise it on a place where CGI questions
are on-topic (check the automoderation rules of
comp.infosystems.www.authoring.cgi before posting).
good luck