legohead6 Posted July 28, 2006 Share Posted July 28, 2006 Hi, I recently redid my homepage and merged it with a secondary homepage! but the problem is the the site is so big im not going to go through everypage redoing the links so they work so i have made the secondary hompage just a message that says youve come here by mistake please click here! but when they click i want it to email me and tell me the page they came from(javascript probably) but i dont know how to find the previous page...EDIT: AUTOmaticly too :P (without them entering anything!) then it takes them to index.php Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/ Share on other sites More sharing options...
ToonMariner Posted July 28, 2006 Share Posted July 28, 2006 you can use $_SERVER[HTTP_REFERER'] to get the url of the last page but this is not always sent by the client!you could indeed use js - not knwoing the answer but imagine it would be something to do with the history object....sure someone will enlighten us both on that one though... Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/#findComment-64912 Share on other sites More sharing options...
legohead6 Posted July 28, 2006 Author Share Posted July 28, 2006 ill see if that works... Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/#findComment-64913 Share on other sites More sharing options...
Caesar Posted July 28, 2006 Share Posted July 28, 2006 Your post is a bit vague? Why would links throughout your site stop working? Why would you have to change them globally? Are you using relative paths to files on your server? Are you using static HTML pages or PHP pages?Also:pg-1.php[code]<?php$refpage = $_SERVER[HTTP_HOST].$_SERVER[REDIRECT_URL];echo"<a href=\"page2.php?referer=$refpage\">Click Here</a>";?>[/code]pg-2.php[code]<?php$referer = $_GET[referer];//Now you can take that value and either email it, or throw it into a table in your db.?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/#findComment-64914 Share on other sites More sharing options...
legohead6 Posted July 28, 2006 Author Share Posted July 28, 2006 well before my index(index.php) was a login page and you had to login to get to the acual index(home.php)! now ive made the accualy index(home.php) the only index (index.php)and put a login box on it but i know there are still some pages i havent changed that link to home.php witch is the old successful login page! so thats what i was doing making home.php email me if a user gets there and from where he got there so i can go in and change the link! Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/#findComment-64921 Share on other sites More sharing options...
legohead6 Posted July 28, 2006 Author Share Posted July 28, 2006 but toons code seems to work! Quote Link to comment https://forums.phpfreaks.com/topic/15845-error-emailing/#findComment-64924 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.