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, 11:25 AM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
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']; 
          if( (stristr($referrer, 'domain.com')) || ($referrer=="") ) { 
               echo '<INSERT CODE>'; 
          } else { 
               include $_SERVER['DOCUMENT_ROOT'].("/path/to/file.html"); 
          }
Disclaimer: yes, there are better ways to write that at the expense of the code being less easily modified.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 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:17 PM.


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