Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Why is my Variable Value not carrying through?

  1. #11
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    ok, basic PHP tutorial:

    when using include or require functions, if you do something like this:

    Code:
    include('$header');
    it looks for the file name $header; however, if you do this:

    Code:
    include($header);
    it then includes the file that is assigned to the variable $header.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  2. #12
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Didn't see testingsites post.
    Jeremy | jfein.net

  3. #13
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Nile, I just realized that your "signature" confused me - I thought it was the answer to my question so I tried to apply it to my code -- sorry, you must have wondered what the heck I was doing.

    TTS, I understand that the quotes turn it into a literal. I am just curious that the result seems to be bad syntax because when the variable is replaced, you end up with:

    Code:
    include(filename.php);
    instead of:

    Code:
    include('filename.php');
    I thought using the quotes around filename.php was proper syntax. But I'm not sure.
    Thanks, erin
    Last edited by kuau; 02-04-2008 at 05:42 AM. Reason: left stuff out

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •