Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter holsclaw

    (@holsclaw)

    I did some testing of multiple pages and it does appear that global variables aren’t shared across pages. Thanks Mitchell for your help.

    Thread Starter holsclaw

    (@holsclaw)

    I really appreciate the help and have read that document.
    Do I understand you that page_one.php and page_two.php won’t collide even if they use the same variable name ($my_title) and both call get_header() to load header.php?
    So is each page load handled by a separate php instance? That seems expensive but I guess it is good news in this case.

    Thread Starter holsclaw

    (@holsclaw)

    >re simultaneous page requests
    Two different users access the site. page_one.php sets the $my_title value to “PageOne”. Then before the header.php code is executed for page one, page_two.php sets the value to “PageTwo”. Since it is a global variable, and assuming that there could be multiple threads generating WordPress content, isn’t it possible that both pages would be displayed with the title “PageTwo”?
    >re: wp_title
    I’ll look into that again. Since header.php makes that call, every approach that I’ve come up with requires passing of some kind of data/flag.
    Thanks again.

    Thread Starter holsclaw

    (@holsclaw)

    Thanks for the reply!
    I have tried that and it does work. However, I have multiple pages that need to pass the data (title). I am concerned that multiple, simultaneous page requests might cause the wrong value to be displayed.
    Is there a ‘safer’ way to do this that would tie the data to the page or request?
    Thanks again,
    Dave

Viewing 4 replies - 1 through 4 (of 4 total)