Closed Thread Icon

Preserved Topic: automatic send mail on page load? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17785" title="Pages that link to Preserved Topic: automatic send mail on page load? (Page 1 of 1)" rel="nofollow" >Preserved Topic: automatic send mail on page load? <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-13-2000 02:57

Greets!

In working on the error pages for gurusnetwork.com, I thought it would be cool if the error page would automatically send mail to the webmaster with key information, such as time and date, and the requested URL. So, for instance, if a user got the 404 error, the error page would fire an email to me saying something like "A user attempted to access http://www.gurusnetwork.com/freemoney but the page was not found."

Does this make sense? Is it possible?

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 07-13-2000 14:36

I attempted to load the page twice, both times I downloaded the content, but then my computer froze. This has happened a couple of other times when attempting to access the GurusNetwork.

That in and of itself is weird.

Ok I was trying to see the page sorce, but I couldn't, so it will make this harder to do.

1) On webpage use the SSI
<!--#exec cgi="virtualpath"-->

2) Make a hidden form on the web page with an input that has the page address that was attempted to be accessed. I notice that someone you dynamically have knowledge of what page access was attempted on, so putting it as a value of an input should be the same deal.

3) a .txt mail template is needed as it will be called from the script.

To: Pugzly
From: The Webpage
Subject: The web page $page failed

The webpage $page had attempted access but the request failed.

4) Make a perl script to use sendmail, I forgot the ins and out of send mail but I could look into it.

use CGI;

$cgiobject = new CGI;

$template = "address to template"
$page = $cgiobject->param('pagename');

require sendmail;
$mail - new sendmail;
$mail->sendMail($template,/%hash);

I am not entirely sure how the use of sendmail would be settup in the script. That require me to sort through some notes. Which I do not have time for now (Calc II test in 30 minutes).

Maybe later tonight if time allows. Bitdamaged are u out there?


www.warmage.org

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-13-2000 18:39

Ok, well, I am getting the requested URL by using
<script language="JavaScript"> document.write(document.location); </script>

There is no other code really on the page. So I just need to kick off a sendmail or something similar via an onload type call. Does this make sense?

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 07-13-2000 22:15

Yes it does, the onload effect you are looking for is the SSI

<!--exec cgi="path"-->

This will kick off the sendmail script. That would need to becreated.

You would also need to have a form created on the webpage that has a hidden value of the page they were trying to access... you could probabally use the same javascript, to insert it into the form.

I don't know about that. Then all you have to do is use any simple PERL mail program that works with sendmail. Having the page name being a variable in the template.


www.warmage.org

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-14-2000 03:57

Okay. I *think* I understand. I'll have to do some digging around a little more.

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-20-2000 16:47

Okay, I'm still lost. Anyone want to take this project and run with it? It's for the error pages on gurusnetwork.com

I want it to send an email each time the page is loaded, and include the URL of the page that was attempted (ie http://www.gurusnetwork.com/freemoney) in the message to webmaster@gurusnetwork.com

A big cookie to whomever gets this to work.

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 07-20-2000 17:59

Does this have to be onload? I think I can get this to work when the user leaves the page easier than when he goes there. I'll try both, don't have a lot of time though my cable modem service has been down at home.


Walking the Earth like Kane

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-20-2000 18:12

Actually, being "script challenged", it doesn't matter. I just want it to be seemless to the user. That way, we can be proactive about potential problems.

including the referer would be nice, as it might point to a bad link on another site.

Just a thought.

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-27-2000 18:33

Okay, looks like I got the 404 page to do this. I found some cool CGI scripts. I'm testing it now, but the email includes everything I need, and, it will log to a file on the server if needed.

If you want to test it (for whatever reason, since you can't see the email), please use the link above. I'll ignore any reports generated to the /freemoney link.

More to follow!

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

[This message has been edited by Pugzly (edited 27-07-2000).]

« BackwardsOnwards »

Show Forum Drop Down Menu