ghurty Posted July 7, 2010 Share Posted July 7, 2010 How would I code it that if a page is being loaded from a particular page (for example a contactsubmit php file) It will display a line like "Thank You". But if someone goes directly to that page it wont. Thanks Link to comment https://forums.phpfreaks.com/topic/206970-how-to-display-a-message-only-if-coming-from-a-particular-page/ Share on other sites More sharing options...
joePHP Posted July 7, 2010 Share Posted July 7, 2010 Hi, You could use $_SERVER['HTTP_REFERER'] so for example if someone was on the about page and clicked the contact page you would get this: http://www.example.com/about.php I hope that helps, Joe Link to comment https://forums.phpfreaks.com/topic/206970-how-to-display-a-message-only-if-coming-from-a-particular-page/#findComment-1082438 Share on other sites More sharing options...
V Posted July 9, 2010 Share Posted July 9, 2010 JoePHP, I think he/she is refering to a contact form. I use this if($_POST) { .....your code... } else { echo "Access Denied!"; } Link to comment https://forums.phpfreaks.com/topic/206970-how-to-display-a-message-only-if-coming-from-a-particular-page/#findComment-1083325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.