Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 747
  • Last Modified:

passing in formation from cgi to html

I have a guestbook.  The CGI script (guestbook.cgi) posts the information to
a HTML page.

guestbook.html => guestbook.cgi => register.html

This is part of the guestbook.cgi file:

print ENTRYFILE "<p><b>$now\n</b></p>";
print ENTRYFILE "<b>Name:</b> $in{'Name'}\n";
print ENTRYFILE "<p><b>Address:</b> $in{'Address1'}\n</p>";
print ENTRYFILE "<p><b>Address:</b> $in{'Address2'}\n</p>";
print ENTRYFILE "<p><b>City:</b> $in{'City'}\n</p>";
print ENTRYFILE "<p><b>State/Provence:</b> $in{'State/Provence'}\n</p>";
print ENTRYFILE "<p><b>Zip Code:</b> $in{'Zip Code'}\n</p>";
print ENTRYFILE "<p><b>Country:</b> $in{'Country'}\n</p>";
print ENTRYFILE "<p><b>Age:</b> $in{'Age'}\n</p>";
print ENTRYFILE "<p><b>E-mail:</b> $in{'email'}\n</p>";
print ENTRYFILE "<p><b>Home Page:</b> $in{'Homepage'}\n</p>";

The top line:  print ENTRYFILE "<p><b>$now\n</b></p>";
posts the date and time the information was posted.  Is there any other
lines I could add that will post any information, such as their IP address
or any other information that might help me find out who posted a message
without indentifying themselves.

I need help ASAP!   Thank you
0
biff2245
Asked:
biff2245
1 Solution
 
ozoCommented:
print ENTRYFILE "@ENV{qw(REMOTE_ADDR REMOTE_HOST HTTP_USER_AGENT )}"
print ENTRYFILE "@{[%ENV]}";

0
 
twexpertsCommented:
insert these two lines into the script:
print ENTRYFILE "<b>Host Name:</b> $ENV{REMOTE_HOST}\n";
print ENTRYFILE "<b>Host IP:</b> $ENV{REMOTE_ADDR}\n";
This will put into the file the name of the host that
the user is using, and also the IP of that host.
I use it for all incomming cgi emails from my site,
it's a very good way to determine legit stuff.

Hope this helps,
Robin (twexperts)
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now