Solved

passing in formation from cgi to html

Posted on 1997-11-18
2
737 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

Suggested Solutions

Title # Comments Views Activity
script issue to add permissions to the registry hive 2 58
Convert Variable to Array 4 24
Copy files and run psex to windows 7 only 14 51
Notepad++ Question 11 26
Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 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