Solved

passing in formation from cgi to html

Posted on 1997-11-18
2
731 Views
Last Modified: 2013-12-25
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
Comment
Question by:biff2245
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1831287
print ENTRYFILE "@ENV{qw(REMOTE_ADDR REMOTE_HOST HTTP_USER_AGENT )}"
print ENTRYFILE "@{[%ENV]}";

0
 
LVL 1

Accepted Solution

by:
twexperts earned 50 total points
ID: 1831288
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to dynamically set the form action using jQuery.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question