Help with some quick regex

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Help with some quick regex

Post by mikusan »

Oh my god i have been up to PHP for all summer and one month and i am lost again... sheesh.. stupid Java

Anywho im just looking for some quick help:
What is the best way to do the following:
I need to make sure that a "forum" pops up only everytime you go to my site, and not when you click on something. Since one of the sites interested in that is a premade engine that i call "borg" because i changed it so much it's like super customized, anyways here is what i am doing, and wonder if there is simpler way:

Code: Select all

if ( !empty($_SERVER['HTTP_REFERRER'] )) {

  $diff = $_SERVER['HTTP_REFERRER'] - $_SERVER['PHP_SELF]';
  if ($diff != $_SERVER['SERVER_NAME'] ) {
    $display = 'some HTML';

  }
}
 $display = 'some other html';
Thank you in advance...
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

By the way the name of my post was when i thought that i would have to use a regular expression to do this... but i felt that would get real hard...unless of course someone is fluent in that alien language and can fill me in. :)

Thanks
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

in my mind if i would like the code would be called each times a client is coming to my site. i would do a javascript code
a simple window.open() would do the job no?
window.open isnt related to the onclick event, so i think its perfect.
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Actually i made a fool of myself... i am using a window.open() already... it's just that it's in a template file and other things depend on it. so everytime i clik on anywhere in the same page it loads the pop up....

I looked into some sessions but in this case since it's not my program it will take days to understand, i am sure there is a faster way.

Thanks
Post Reply