View Single Post
Old 2012-02-29, 06:22 PM   #2
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
Quote:
Originally Posted by cd34 View Post
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.
Good observation. What does the code below mean?

PHP Code:
|| ($referrer=="") ) 
Another helper directed me to simply delete the first condition without adding anything. I would appreciate any indications in order to understand things better. Thank you.
A.J. Angel is offline   Reply With Quote