commanda Posted August 26, 2007 Share Posted August 26, 2007 I want to instigate an automatic error reporting system; send an email to the sys admin when a mysql error occurs. I want to do this by including a standard include file which will read the current pages url plus the mysql error message. eg: $result = mysql_query(" blah'" ); if(!$result) { include("email error to sysadmin.inc"); echo "error has been emailed to sys admin"; exit; } email error to sysadmin.inc subject = system error body = page.url + mysql error message email address = sysadmin send email Q: how do I read the current pages url? It can't be hard-coded because it will usually include a heap of GET strings particular to the current error. Any help appreciated. Amanda Quote Link to comment https://forums.phpfreaks.com/topic/66742-solved-read-the-current-pages-url/ Share on other sites More sharing options...
pranav_kavi Posted August 26, 2007 Share Posted August 26, 2007 try tis code, <?php // find out the domain: $domain = $_SERVER['HTTP_HOST']; $url2 = "http://" . $domain . $_SERVER['REQUEST_URI']; echo "The current url is: " . $url2; ?> Quote Link to comment https://forums.phpfreaks.com/topic/66742-solved-read-the-current-pages-url/#findComment-334449 Share on other sites More sharing options...
commanda Posted August 26, 2007 Author Share Posted August 26, 2007 Perfect, that's it exactly. Thanks muchly. Amanda Quote Link to comment https://forums.phpfreaks.com/topic/66742-solved-read-the-current-pages-url/#findComment-334496 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.