Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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

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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-08-26 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (369 votes). Check out past polls.