Page 1 of 1

Help with some quick regex

Posted: Mon Sep 29, 2003 11:47 am
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...

Posted: Mon Sep 29, 2003 11:52 am
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

Posted: Mon Sep 29, 2003 5:37 pm
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.

Posted: Mon Sep 29, 2003 5:49 pm
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