I would like to be able to call a subroutine based on meeting an HTTP_REFERER qualification and using input from a select box in a form to define the sub-routine that is called. What I can not figure out, being an embarrassingly uninformed newbie, is how to write the code to replace ($action) in the subroutine call after the condition is met. Can anyone please help me solve this problem?
here i shortended the if statment for the referer so this way, you use less lines and server memory,
that should do whant you want, but still there are better ways, depending what you want, so if you could explain the hole thing, we migh give you a better solution,
if it is like for making a hole site into one script tell me, that the way i work
calilo
Thank you for the solution. To answer your question, only 8 pages of the site will be included in the script.
One more question, if I may .... can I break down the subs into separate files and use a require statement ...
i.e.
require "Page_1.cgi"
require "Page_2.cgi"
etc., etc.
sure you could but it is better to stay with just one script for it all.
what i do for scripts like this, (sites Like this one (http://www.cuernaonline.com/main.cgi) ) is set a simple zone variable $z, and then redirect into the script using subroutines, for each zone in the site.
like
if ($z eq 1) {&main_page}
elsif ($z eq 2) { &surveys}
and so on, just as you are doing it now
calilo
Thank you again for the response. I will take your suggestion and stay with one script.