Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Running Perl thru HTML

by FitTrend (Pilgrim)
on Mar 14, 2005 at 14:05 UTC ( #439280=note: print w/ replies, xml ) Need Help??


in reply to Running Perl thru HTML

Yes you can. What you can do on your webserver (I'm assuming apache) is to configure your directory with the ExecCGI directive in your httpd.conf file.

AddHandler cgi-script .cgi DirectoryIndex index.html index.cgi index.html.var <Directory "DIR OF CHOICE"> Options Indexes FollowSymLinks ExecCGI AllowOverride none Order allow,deny Allow from all </Directory>

Then create an index.cgi file that performs to reference the variable $ENV{'REMOTE_ADDR'} variable within your script. Then utilize that value to perform your task. Lastly, redirect the user to that page. I personally use javascript (because sometimes I refresh multiple iframes or frames) for my redirects, like:

print qq { <script language=javascript> window.open('/dir/$ENV{'REMOTE_ADDR'}.html','','') </script> };

Hope this helps


Comment on Re: Running Perl thru HTML
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://439280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-08-30 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls