damdempsel Posted February 10, 2010 Share Posted February 10, 2010 I want to make a script that E-mails me when there is a dead link on my website. I have the E-mail part of it set up, the only thing I cant seem to do is get the page that the dead link is on. Is there a way to do this? Can you use PHP to find the last visited page? If you need me to clarify something just let me know. Any help is welcome. Thanks. Link to comment https://forums.phpfreaks.com/topic/191569-dead-link-script/ Share on other sites More sharing options...
alexjb Posted February 10, 2010 Share Posted February 10, 2010 By dead link I assume you mean 404? While I've never done what you're asking, you could probably configure apache to load a custom .php script on 404. It would then be a simple case of having the script retrieve the URL and emailing you the details. Link to comment https://forums.phpfreaks.com/topic/191569-dead-link-script/#findComment-1009848 Share on other sites More sharing options...
damdempsel Posted February 10, 2010 Author Share Posted February 10, 2010 Yes, I do mean 404. I have a custom 404 error page that should send me an E-mail of the page that the dead link is on. E-mail works fine, I just cant figure out how to get the page the link is on. Link to comment https://forums.phpfreaks.com/topic/191569-dead-link-script/#findComment-1009852 Share on other sites More sharing options...
alexjb Posted February 10, 2010 Share Posted February 10, 2010 $URI = $_SERVER['REQUEST_URI']; edit: wait, you're redirecting on a 404? In this case it would be given by: $_SERVER['HTTP_REFERER']; Link to comment https://forums.phpfreaks.com/topic/191569-dead-link-script/#findComment-1009855 Share on other sites More sharing options...
damdempsel Posted February 10, 2010 Author Share Posted February 10, 2010 Thanks. Link to comment https://forums.phpfreaks.com/topic/191569-dead-link-script/#findComment-1009858 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.