Solved

passing in formation from cgi to html

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now