Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quietly notify by email onLoad of a page

Status
Not open for further replies.

engcomp

Programmer
Jun 18, 1999
66
AU
Below are some code snippets, the purpose of which is to quietly notify me by email when a particular site is requested. You can see that I use Matt Wright's famous formmail.cgi, which insists on sending the user to a redirect page.

This email code is in the index.html of the site.
The site's real stuff is in the redirected main.html

The question are:

1. Will this interfere with search engine spiders, causing the real stuff never to be seen?

2. Do you know of any form2email program that doesn't insist on a "thank-you" page, so that the process can be put on the main page, instead of a lead-in page?

Thank you for a fine forum, Helmut

Snippets of code:

var visitorname = GetCookie('visitorname');
var visitoremail = GetCookie('visitoremail');

function InitializeForm() {
document.notify.realname.value = visitorname;
document.notify.email.value = visitoremail;
document.notify.submit();
}

<body onload=&quot;InitializeForm();&quot;>

<form name=&quot;notify&quot; action=&quot; method=&quot;POST&quot;>
<input type=hidden name=&quot;recipient&quot; value=&quot;engcomp@ozemail.com.au&quot;>
<input type=hidden name=&quot;subject&quot; value=&quot;notify main&quot;>
<input type=hidden name=&quot;redirect&quot; value=&quot; <input type=hidden name=&quot;email&quot; value=&quot;noEmail&quot;>
<input type=hidden name=&quot;realname&quot; value=&quot;noName&quot;>
<input type=hidden name=&quot;env_report&quot; value=&quot;REMOTE_HOST,REMOTE_ADDR,REMOTE_USER,HTTP_USER_AGENT,HTTP_REFERER&quot;>
</form>

</body>
 
If you are running an IIS based system, you could use ASP and a component such as ASPEmail to do the same thing.

The component was free, the last time I looked and comes with code samples. The site is at cquick@callingpost.com
Geographic Information System (GIS), ASP, some Oracle
 
The method I describe above has another drawback:

When the user clicks the <Back> button, main.html goes back to index.html, which sends another email and redirects to main.html, looping forever until the user stops using the <Back> button.

Is there a solution to this problem?

Thank you for your interest, Helmut
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top