Jump to content

Recommended Posts

Posted

Greetings-

 

I made a custom 404 error page on the CP, but would like to receive realtime notification of broken links as well.

 

Ideally would be an e-mail that includes the faulty url.

 

I can use the html tag to make the url display on the page- how can I get it included in an e-mail?

 

Thank you,

 

Nablusi

Posted

I used to have a script that did that but it required that the user tap a button to send the information. I removed it because nobody ever did. In your cPanel you can get a list of 404 errors using Awstats and that's how I correct any that happen to appear.

Posted

Thanks Bruce,

 

I used to have a script that did that but it required that the user tap a button to send the information. I removed it because nobody ever did.
Sounds useful to me- I have been using a simple mailto link, but people send them without citing the url they were looking for. If you have the source for the script, I would be happy to see it.

 

In your cPanel you can get a list of 404 errors using Awstats and that's how I correct any that happen to appear.

 

I know, but its not realtime, and it doesn't give me an oppurtunity to give feedback to the visitor who got lost ;-)

 

Thanks,

Nablusi

Posted

I believe it was TCH-Don (Turtle) that came up with something like :

 

<form NAME="404error" METHOD=POST ACTION="path/to/form/handler">

<textarea style="position:absolute;visibility:hidden" name="error">

<!--#echo var="REQUEST_URI" -->

is not found here,

the refering page was

<!--#echo var="HTTP_REFERER" -->

</textarea>

<br />

<textarea name="message" value="message" rows="7" cols="55">

<!--#echo var="REQUEST_URI" -->

is not found here,

the refering page was

<!--#echo var="HTTP_REFERER" -->

</textarea>

<br />

<input type="submit" value="Click to report this error">

</form>

 

I added the hidden fields as I discovered some people would mess with the displayed results. This way I always get the true error. You could add other fields to the form as well. (requires user to click)

 

example - naugatuckarts.org/any_bogus_name.html

 

I had one for a while that auto notified me but I can't find it now. Used 'body OnLoad() ' to send the page to me. I'll look for it.

Posted

Thank you boxturt!

 

Form looks good and works- just that I am apparently lacking the right string for sendmail.

path/to/form/handler
I tried adding:
/usr/sbin/sendmail

 

but that's not it :-(

 

"mailto" works, but triggers a security warning.

 

Any suggestion?

 

Thank you,

Nablusi

Posted

My 404 uses a couple on-screen notes to the visitor, and with a tap bar to send the error to me. I get people to click the bar by offering another page with alternative links that might be working. I also monitor AWSTATS for 404 notes.

 

This is the code I use on my 404 page that you can try here: (paste URL into your browser) www.samisite.com/test404.htm

 

Place this where you want to DISPLAY the page the visitor was requesting"

<!--#echo var="REQUEST_URI" -->
Set up an email form with your regular form processing header following this type of format. Note that YOUR form processing header would point to the code that you use. If you process your own mail, it would point to the PHP or CGI script on the TCH server. If you use a 3rd party processing like cutandpastescripts.com, it would point to their server. Take a look at the coding you have used on other forms on your site and copy the header section.
<form NAME="404error" METHOD=POST ACTION="path/to/form/handler">

<textarea style="position:absolute;visibility:hidden" name="error">

 

Then I use this as my BODY of the email:

<textarea  name="error" style="position:absolute;visibility:hidden;">

This page was not found:

<!--#echo var="REQUEST_URI" -->

The referring page is:

<!--#echo var="HTTP_REFERER" -->

</textarea>

And I made my tap bar request their assistance:
<INPUT TYPE="submit" value="click to report error and see alternative links" name="tlx_send" onfocus="this.blur()" style="background-color:#C0DCC0;color:#680098;font-weight:bold">  

</form>

 

-Samantha

Posted

I've searched for the script I was using but it's gone. Sorry. The one that Ty posted is actually better than the one I had.

 

As for having 404 errors automatically sent I don't think you would want to do that. For every 404 that was looking into your cgi-bin folder for open scripts to run you could get a lot of email for scripts that don't exist. Just my .02 cents. :dance:

Posted

Samantha-

 

That is a very nicely designed page- good idea that it gives incentive to report by providing additional links.

 

Bruce-

 

Good point about the pitfalls of automation- good to have a forum of people with experience!

 

Now that you've all answered the serious questions- I'm left looking for the address of the sendmail function to place in the form.

 

In the CP is says that the path is:

/usr/sbin/sendmail
I pasted it in place of
path/to/form/handler

but it doesn't work ;-(

 

[i don't have a working form on the site to copy from.]

 

Thank you,

 

Nablusi

Posted (edited)

You need an actual form proccessor.

I used DodosMail.

 

But now I just use a 404 Error handler to send the email

without the visitor doing anything, it uses the php sendmail function.

I got the idea from the

the scripty goddess

it uses a file to keep track of missing pages and will send the e-mail when a new missing page shows up.

Edited by TCH-Don
Posted

Thanks Nablusi. Once I got the format down to something I liked, I use the same concept (different colors, sounds and images) for several sites.

 

Yes Thomas, in CSB the page was created quickly and easily. The 404 and the thankyou/link pages are in my main tlx file and publishes to my public_html folder.

 

Page Properties settings:

Short Title = 404

Page extension = shtml

 

I used insert HTML for these codes:

1) My images are placed into the page using a CODE rather than using insert picture feature

<IMG SRC="http://domainname.com/imagename.jpg" border=0 width="128" height="88" ALT="site logo">

 

2) I have a sound embedded in the page:

<embed src="http://domainname.com/soundname.wav" autostart="true" hidden="true">

 

3) a scrollbar style code (you know what those look like...if you need one take a look at my iframe instructions for the code)

 

4) I wanted the visitor to see the page that had the error so used this code in a table at the top of the page:

<!--#echo var="REQUEST_URI" -->

 

5) Form code as noted in my previous post to submit the error notification. When you click, the form takes you to another page (errorthanks.htm) with a thank you and additional links. On one site, I have the form take you to a site map with all sections of the site listed.

 

The code snippets that return info (echo...) were recommended by other TCH folks in a 404 page topic and used to be posted at the beginning of one of the forums as a pinned topic. Don't know if the thread is still pinned or not. Was really quite a useful topic thread!

 

Will need to take a look at Don's post a little closer. More php to play with.

 

-Samantha

Posted

Thanks for the lovely unexpected compliments.

 

You did a very nice job Nablusi! Thumbs Up

I like your little computer guy

 

-Samantha

Posted
But now I just use a 404 Error handler to send the email

without the visitor doing anything, it uses the php sendmail function.

I got the idea from the

the scripty goddess

it uses a file to keep track of missing pages and will send the e-mail when a new missing page shows up.

I have tried this script with various results (sometimes it sends a email, sometimes not).

However, is this script supposed to tell me which url the visitor tried to enter? :)

Because in my case it doesnt, which make it difficult to know which page to fix. :(

Posted (edited)

So if lets say Jessica links directly to one of my pages and that link is misspelled, then Jessicas site would be referer in this email?

 

Second, the link from Jessicas site (misspelled or not) would also show up in this email?

Edited by Jikrantz
Posted

That is correct if it is transferring the referral information. I have implemented this script and I have been getting errors with and without referrer information.

Posted
if it is transferring the referral information

Since I am the one maintaining Jessicas site I better ask, will a site send thisreferral info as default or will I have to insert some script to Jessicas site to make it work or is the script mentioned in Dons post enough if placed on my site?

Posted

One more question...

 

Does this script contain some function like "if the error is reported one time then no more reports for that error is sent"?

 

Why I ask is because I have tried it out 5-6 times today but only gotten one report which was from test #1.

Posted (edited)

yes it does :)

 

I found out that my 404 page was visited quite often... usually for the same three files.

 

So I modified the script a bit - so that it would keep a list of missing files. If a NEW page was requested (that didn't exist) it would email me THEN (only once) - and add that new page to the list.

Edited by TCH-Bruce
Posted

If you follow the part

//upload a BLANK TEXT FILE to your server

//named "missing.txt"

//CHMOD 777 on this file

//enter the full server path* to this text file below

$missinglist = "/home/cpanelname/public_html/missing.txt";

then the script will scan the text file,

and if the missing page is not there,

it will add it to the file and e-mail you

I like this because if you have a bad link,

you will not be flooded with error e-mails.

Posted

Yep. I like it too now when I figured out why I have been waiting for weeks to have it email me some bad links.

I better explain "weeks" so I dont confuse anyone. Don told me about this script several weeks ago. I inserted it. Waited and waited. No email. I gave up. Saw this thread and figured I give it one more chance, this time on Jessicas site.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...