Page 1 of 1

Capturing sender's information

Posted: Fri 6. May 2005, 15:42
by deanloh
Seems like no one brought this up before, has anyone thought about capturing basic data of senders (such as IP, hostname etc) who use the email form? I received a couple of hostile emails, am thinking about talking to the Feds... just kidding. But hostile emails is true.

So can someone show me the way?

Posted: Sun 12. Jun 2005, 09:02
by Pageman
It's a bit long since you posted, but the question interested me so I went looking for a method.

Code: Select all

<!-- Original:  Hostroute.com -->
<!-- Web Site:  http://www.hostroute.com/resources/script_ip.html -->

#you can add other fields to the form and use it witha formmail or other script.

<form method="post" action="" name="myform">
  <input type="text" name="ipaddr" value="<!--#echo var="REMOTE_ADDR"-->" readonly>
</form>
Information at http://www.hostroute.com/resources/script_ip.html said:
This captures the IP address of the person filling in your form and submits it to you as part of the form. The IP address is displayed in a text box which the user cannot edit.

The script works by taking the #echo var="REMOTE_ADDR" from and placing it in the text box. You will need a web server capable of running SSI (most web servers do this by default). The page with the form in it needs to have the suffix .shtml to tell the server to parse it.

Posted: Mon 13. Jun 2005, 08:51
by trip
Hi Pageman
would it be possible if you could add more info to which files you edited ...

thanks
TriP

Posted: Wed 15. Jun 2005, 07:12
by Pageman
trip,

This is a client side script, so the only file you would need to edit would be the one that has a mail form on it. If it were an HTML page, it would just be the HTML file, but if it's something made in WCMS, you would edit the article or whatever content contains the form.

I've not tried it out, but would seem to work, and I'll probably slip it into mail forms on some sites I maintain when I find a few minutes to test drive it.

The "action" in the form would be

Code: Select all

action="mailto:whoever@whereever.what" 
unless you are using a PHP or CGI mailer, then you would need to know what action to call in your script. Otherwise, probably all you need is an input button

Code: Select all

<input type="submit" value="send e-mail or whatever"> 
inside the form tags to bring the browser's mail client up with whoever@whereever.what in the send-to line.

Posted: Wed 15. Jun 2005, 07:22
by deanloh
Pageman

I think we are on different track here. You might want to play around with phpwcms more and you will know what you are talking about, and what we are talking about.

But inspired by what you wrote, it occurs to me that I could edit the script directly and throw in the $_SERVER['REMOTE_ADDR'] to the message body portion of the sendmail command bit. Only thing is, doing so will end up having IP info being included whenever I use the contact form.

I'm just hopping this can be part of the options in the current contact form, that we can trigger on or off, just like how we can trigger a required field.

Posted: Thu 16. Jun 2005, 03:31
by Pageman
deanloh wrote:Only thing is, doing so will end up having IP info being included whenever I use the contact form.
Yeh, the suggested use for this included letting users know you have their IP info -- it can show in a text box as they submit the form.
deanloh wrote:Pageman

I think we are on different track here. You might want to play around with phpwcms more and you will know what you are talking about, and what we are talking about.
.
Probably. I don't use "the" e-mail form, I use "an" e-mail form which serves my needs quite well, which is why i suggested it. You might be right that I might settle into a packaged back-end once I become familiar with a particular favorite package.

The only real need that sent me looking for a back-end (besides that had used some and they were handy ways to maintain existing sites) was that I need to give users a WYSIWYG editor, probably along with an easy image-processing front end for users, and maybe a site menu manager. For now, common CGI and Perl freewares, along with whatever I hack together serves my needs quite well for forms, forums, etc.

As the site grows, databasing probably could make content storage easier to manage, but a file-oriented back-end would be quite adequate, if it had a super-simple front end.

I could see where I was going vis-a-vis what people are packaging in freeware CMS's when I pasted my table oriented background layout into the "custom" template page -- I don't need "headers" "footers" or "articles" -- they tend to get in the way of the format I already established. In fact, my first goal in laying out this particular site was to violate familiar column-and-block orientations, which I did by stacking images over background lines and using variously sized images on different pages against a similarly themed background that maintains the integrity of the namespace.

The dynamic of the site I'm easing WCMS into is not built around "articles" though I can call them that. The ideal CMS for my needs is probably more along the lines of a Wiki CMS -- a backend with a very strong front end that will let unskilled users format announcements, schedules, event promotions and historical group information online using about the same skills they would need to run a standard word processor - drop-down font menus, WYSIWYG formatting, drag-and-drop content boxes, etc.

Nonetheless, if I continue deploying PHPWCMS for this task, once I'm familiar with it, I'll probably write some sites that rely much more heavily on its embedded features, instead of using it to manipulate the scripts I am already familiar with. If nothing else, it's handy to have all of the various scripting in one expansible package.


Anyway, good luck if you slip that line of code into your site. I'll soon be looking for much more data on my users than I get from my host, and this trick will probably be the first thing I try.