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.

PHP Problems

Discussion in 'PHP' started by nigelwong, Jul 5, 2006.

  1. #1
    Hello,

    On my site, it consists of a few PHP scripts. This is how it works:
    Loads functions.php
    Loads a php include, which contains a function that functions.php needs to process. However, within that function contains another variable, which another script needs to process (done afterwards).

    The problem is, since the function requested the processing of functions.php, but the variable inside the function has not yet loaded, it does not work properly.

    Ill try and make it more simple:
    <?php include functions.php ?> (Function contains $id function processing)
    <?php include content.php ?>

    Content.php contains $id=$value. Function needs to process $id, but $value still has not been processed yet, therefore it does not work properly. Later in content.php it processes the value, but it has already asked functions to process the id, therefore the value is still unknown.

    I've tried ob_start, but it doesnt work.

    Any ideas? Thanks
     
    nigelwong, Jul 5, 2006 IP
  2. reza56

    reza56 Active Member

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    You must use $GLOBAL in functions.
     
    reza56, Jul 6, 2006 IP
  3. Allan

    Allan Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    "global variables"
     
    Allan, Jul 8, 2006 IP