![]() |
PHP Referrer & Display Help
Hello,
I am currently using the following code below to display two different codes depending on referrers. It came to my attention that if the page is visited from a direct url or a bookmark for example, the include is not working. It only works if the page is visited from "somewhere". As such, I wish to ask if someone may be able to "fix" the code. Basically, I wish to display the first code if the visitor comes from domain.com otherwise, the include is displayed no matter where else they come from. Thank you in advance. PHP Code:
|
On a bookmark or typein, HTTP_REFERER won't be set - and your condition skips your includes in that case.
Code:
$referrer = $_SERVER['HTTP_REFERER']; |
Quote:
PHP Code:
|
if you just delete the first condition, if the referrer is empty, it would do your include. My guess at your intention was to include the local code if it was a typein/bookmark or local site referrer, and include the /path/to/file.html if it was a remote referrer.
|| ($referrer=="") ) says: or, the referrer is empty if you want to include the INSERT CODE for local hits + bookmarks/typeins, you want to use the || ($referrer=="") ) version. If you want only want to display INSERT CODE for local hits, and bookmarks/typeins/remote referrers get the /path/to/file.html, then just removing the isset() condition would do that. |
Actually, my intention is the contrary, intending to display the
|
All times are GMT -4. The time now is 12:13 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc