Solved

passing in formation from cgi to html

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

636 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