I want to place the link to the PHP Contact form on the pages of my website and it should pass the URL of the page from which the contact form link is Clicked to an Input (either text box or Hidden) on the contact form along with other fields.. Please tell me how to do that.. can it be done by placing the code in the A HREF Link or by placing the code in contact form itself? Thank You..
<input type="hidden" name="referrer" value="<?php echo (isset($_SERVER['HTTP_REFERER']) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : ''); ?>" /> Code (markup):
Thanks sir.. This uses the PHP code to retrieve Referrer from the HTTP header.. But will this work if the Browser is disabled to send referrer information to the next page? can any thing added to the A HREF link so that the referring URL is added to the Contact form field or into the contact form URL ?
Most people do not have referrers disabled, this should be a non-issue. You could ofcourse change your contact page href link to: <a href="contact.php?ref=<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>">contact</a> And then use that value in a hidden input field.
Oh.. ok.. Thanks a Lot.. I will try this.. Sir will you please see my other thread where I have asked a help... http://forums.digitalpoint.com/showthread.php?t=1495781 (Needed Question Answer Script with following features..) Please check it sir..