Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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>'/dir/$ENV{'REMOTE_ADDR'}.html','','') </script> };

Hope this helps

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2016-05-01 01:17 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.