Announcement

Collapse
No announcement yet.

Need help adding PHP script..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Helza
    replied
    Yes i know how that goes, but I want to know where I add this code (the one i wrote) in which file, etc...

    Leave a comment:


  • Menno
    replied
    I think it will be quite safe to add this to the top of your php/html file (between <? and ?> ofcourse), and then call $go where needed: <? echo"$go"; ?>

    there isn't really a step by step, since everything you try will always carry a bit of risk :)

    Leave a comment:


  • Helza
    replied
    I'm afraid I only have 1 MySQL db available.. can't add an 2nd one :(

    About the code well its nothing special.. check for a cookie if its there or not.. and if not then it just places a cookie..

    and later on it depends on the cookie what will happen..

    here is the code:

    ----
    $ip = getenv("REMOTE_ADDR");
    $popup='yes';
    $go="open(\"http://www.clickheretofind.com/index.php3?l=helzaexit\",\"_blank\");\n";


    // IF COOKIE:
    if (isset($TestCookie6) OR ($TestCookie6<>'')){
    $time=time();


    // POP-UP ON EXIT AND PLACE NEW COOKIE
    if ($TestCookie6 < $time){$popup='yes';}
    else{
    if (isset($TestCookie5) OR ($TestCookie5<>'')){
    if ($ip==$TestCookie5){$popup='no';}
    }
    }
    }

    // 43200
    if ($popup<>'no'){
    $expiretime=time()+43200;
    setcookie("TestCookie5",$ip,time()+43200);
    setcookie("TestCookie6",$expiretime,time()+43200);
    }

    if ($popup=='no'){
    $go=" ";
    }


    --------------
    and in the HTML part it displays is a small piece of Javascript code which has $go in it..

    Leave a comment:


  • Menno
    replied
    Yes, best thing is to set up a testing area. If this is impossble, then coulkd you post all the code that's involved, and a detailed description of what you need done?

    Leave a comment:


  • thetakerfan
    replied
    you can install an test forum JUST to test things out on, like hacks and stuff like that, it just can't be a publicly available forum. Just somewhere that you can try stuff out before putting it on the main boards

    Leave a comment:


  • Helza
    started a topic Need help adding PHP script..

    Need help adding PHP script..

    Hi guys,

    I need some help..

    I need to add an php script to my forums on my site .. however this piece of script must be executed before anything else is displayed on the page (setcookie stuff)

    and I need to add an value into the Body tag ones its executed...

    The problem is, I can not test this out because my forums are heavily used so i can't mess around and get it to work with trail and error like i normally do..

    Can anyone please help me in a "step by step" fashion?


    [Edited by Helza on 12-16-2000 at 11:27 AM]
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X