johnhb Posted April 10, 2007 Share Posted April 10, 2007 I have two different webpages that call the same email.php and I need to detect which page calls so that I can go back to the correct page. I am not sure how to phrase the question so I was no successful in searching for an answer, if one exists. Would appreciate any guidance. Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/ Share on other sites More sharing options...
Glyde Posted April 10, 2007 Share Posted April 10, 2007 $_SERVER['HTTP_REFERER'] Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/#findComment-226349 Share on other sites More sharing options...
johnhb Posted April 11, 2007 Author Share Posted April 11, 2007 Thanks for the assistance, Glyde. Not sure quite how to implement $_SERVER['HTTP_REFERER'] I want to alter this line depending on which page sent the request. onClick="location.href='psearch_cars.php'"> tried "location.href=$_SERVER['HTTP_REFERER'], but does not work. Obviously I am missing something here - just a lack of experience. Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/#findComment-226476 Share on other sites More sharing options...
tippy_102 Posted April 11, 2007 Share Posted April 11, 2007 This isn't php, but how about: go <a href="javascript:history.back(-1);">back</a>. Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/#findComment-226494 Share on other sites More sharing options...
techtheatre Posted April 11, 2007 Share Posted April 11, 2007 try this: <?php echo "onClick=\"location.href='" . $_SERVER['HTTP_REFERER'] . "'\">"; ?> Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/#findComment-226496 Share on other sites More sharing options...
johnhb Posted April 11, 2007 Author Share Posted April 11, 2007 Thanks very much techtheatre - your code works fine - much appreciated. Link to comment https://forums.phpfreaks.com/topic/46514-solved-which-page-called-my-emailphp/#findComment-226584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.