Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2012-02-29, 03:14 AM   #1
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
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:
      if(isset($_SERVER['HTTP_REFERER'])) {
          
$referrer $_SERVER['HTTP_REFERER'];
          if(
stristr($referrer'domain.com')) {
               echo 
'<INSERT CODE>';
          } else {
               include 
$_SERVER['DOCUMENT_ROOT'].("/path/to/file.html");
          }
     } 

Last edited by A.J. Angel; 2012-02-29 at 03:22 AM..
A.J. Angel is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:29 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc