1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Utilizing exit traffic with PHP?

Discussion in 'PHP' started by corb, Dec 2, 2009.

  1. #1
    Is there an "on exit" method, or a way of interacting with exit traffic using php?

    I tried googling an "on exit" routine with PHP but I just couldn't find anything.
     
    corb, Dec 2, 2009 IP
  2. kingsoflegend

    kingsoflegend Well-Known Member

    Messages:
    202
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #2
    PHP doesn't have this feature but javascript does.

    Use
    <body onUnload="javascriptFunction()">
    Code (markup):
     
    kingsoflegend, Dec 2, 2009 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This isn't possible with PHP whatsoever since PHP is a server side language, so all PHP code executes BEFORE the user ever sees the html it generates and sends to their client
     
    JAY6390, Dec 2, 2009 IP
  4. corb

    corb Peon

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks both of you for the help! Answered my question completely (and the follow up question I had planned as well)
     
    corb, Dec 3, 2009 IP
  5. amine

    amine Active Member

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #5
    you can callback on fucntion ob_start
    <?php

    function callback($buffer)
    {
    // remplace toutes les pommes par des carottes
    return (ereg_replace("pommes de terre", "carottes", $buffer));
    }

    ob_start("callback");

    ?>
     
    amine, Dec 3, 2009 IP
  6. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What has that got to do with this question?
     
    JAY6390, Dec 3, 2009 IP
  7. kingsoflegend

    kingsoflegend Well-Known Member

    Messages:
    202
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #7
    What does replacing potatoes with carrots have to do with anything?
     
    kingsoflegend, Dec 3, 2009 IP