Link to home
Start Free TrialLog in
Avatar of TP090398
TP090398

asked on

Need CGI That Gives Name & Email Address of Web Visitors

Is there a CGI script out there that you can run on your web site that will give you the visitor's name, email address, etc? I saw a web site called SiteGuest.com that supposedly does this.

Thanks.
Avatar of mouatts
mouatts

A CGI can only obtain the data present within the Environment variables, or within the fields of a form.

As neither the email address or name is present within the standard environment variables you can only obtain them by the user completing and submitting a form.

However what you can do is provide a link that does a mailto to your own account. The message will have the senders mail address wiithin it. However the user will be prompted before the mail message is issued so that they can prevent you from 'stealing' there email address.

Steve
Avatar of TP090398

ASKER

There was a program called WWWatch that was out there and claimed to do this. Also, the site I mentioned (SiteGuest) has been marketing this services and a few business associates on the Internet (who I know to have excellent reputations) are also trumpeting success with this service. It claims to be transparent. Again, if anyone knows about a CGI or Java script that gives you the name, email address, etc. of web site visitors, please help me out.

Thanks.
As far as I know, mouatts is right. You cannot get someone's email address without him filling it in on a form or sending a form using action="mailto:" in which case his browser opens his mail program and sends an email (with the address in the header). BTW, I very much _hope_ that there is no other way, because it would be heaven for email harvesters.
I just looked at the siteguest site. It states that the user will be notified by his browser that he is giving over his address so it is probably done the way I said.
The following HTML/JavaScript will do the trick. Use your email address for the mailto. Insert the onload command in the <body> tag of the page. The dummy hidden field appears to be important for this trick to work, otherwise IE will open your mailing program instead of sending the form.

<body onload="document.forms[0].submit();">
<form enctype="text/plain" action="mailto:your@email.com" method=post>
<input type="hidden" name="dummy" value="">
</form>
</body>

You will receive an email from every visitor to your site with their name and email address in the header. Also IP information if you want it.

As it said in the siteguest site, the user will receive a popup notice that he is disclosing his email address.
Thank for the responses, but I tried that code and it didn't seem to work. Was there something else I must set up? Was there something I missed? I need more help.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of rafistern
rafistern

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial