Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://439280]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-01-22 19:25 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (236 votes). Check out past polls.