[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] 2 questions



At 23:33 -0500 6/15/1999, Michael D. Kirkpatrick wrote:
>1.  On the HTML side, how can I call a CGI script as part of the html
>code when image loading and java/java script is turned off?

If you mean how do you execute a script when somebody first logs in 
if onLoad is turned off, you can use an index.cgi instead of an 
index.html file assuming that your server software will cooperate. 
The cgi could render the contents of the home page as well as do 
other things. If you just mean how do you call a cgi from a page if 
no gizmos are running on the user's browser, you just use <A 
HREF="/cgi-bin/myscript.cgi">Click Here</A> or set up a form.

>2.  I am working writing a tracker program and I need to know what
>section or list of variables to use to gather all information that is
>passed from the client browser.
>Example:
>IP address
>referral URL
>keyword search from a search engine
>browser type
>etc...

I've forgotten who it was, but somebody once posted the following to 
the list and it should get you started in the right general direction:

#!/usr/bin/perl -w
alarm(10);

print "Content-type: text/html\n\n";

print <<"EOF";
<html>
<head> <title> Environment Variables </title> </head>
<body>
<center>
<table border=2 cellpadding=10 cellspacing=10>
<tr><th align=left><h3>Environment Variable</h3>
<th align=left> <h3>Contents </h3></tr>
EOF

foreach $var (sort keys(%ENV)) {
     print "<tr><td> $var </td><td> $ENV{$var} </td></tr>";
}

print (qq#</table>\n</center>\n</body>\n</html>\n#);


Richard Gordon
--------------------
Gordon Consulting & Design
Database Design/Scripting Languages
mailto:richard@richardgordon.net
http://www.richardgordon.net
770.565.8267

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org