SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot SystemLogic's Avatar
    Join Date
    Jan 2001
    Location
    Northern VA
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Possible easy fix?

    I'm a newbie when it comes to PHP, but here's my scenario:

    I have one file (the main file - index.php) that is doing an include on a variables.php. Then I there is another include for a different variables PHP file. I am also using an include for another file which has some PHP code using variables from both of the variables.php file...but they are not parsing. Is there anything I can do to resolve this?

    Let me know if what I wrote doesn't make sense, I can make a diagram to better show the relationship.

  2. #2
    SitePoint Evangelist ClickHeRe's Avatar
    Join Date
    Mar 2005
    Location
    Ottawa, Canada
    Posts
    580
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that would be nice of you and outline which includes what and their respective file names too

  3. #3
    SitePoint Zealot GWild's Avatar
    Join Date
    May 2005
    Location
    Colorado
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible for you to include a code snippet of your implementation?

    Also - are you getting 'unable to include....' messages, or it 'seems' as though the files are not being parsed?
    Lang ist der weg und hart,
    das aus der hoelle fuehrt auf zum licht.


    My Site

  4. #4
    SitePoint Zealot SystemLogic's Avatar
    Join Date
    Jan 2001
    Location
    Northern VA
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll get something prepped for you guys so this all makes sense as soon as I get back to the home office. Not getting any errors, just coming blank basically...so I'm assuming the variable exists but it loses the data somehow?

  5. #5
    SitePoint Zealot SystemLogic's Avatar
    Join Date
    Jan 2001
    Location
    Northern VA
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out the attachment, let me know if it makes sense now. If you need to me post actual code, let me know.
    Attached Images Attached Images

  6. #6
    SitePoint Zealot SystemLogic's Avatar
    Join Date
    Jan 2001
    Location
    Northern VA
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anybody?

  7. #7
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add error_reporting(E_ALL); at the top of script.

  8. #8
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found with PHP (5.0.3) variables included in one file don't pass on through to another file.

    Try something like this in home/test/beta:

    PHP Code:
    function test3($test2) {
        return 
    $test2 '$test3';

    Then in index.php try something like this:

    PHP Code:
    echo test3($test2); 
    It works for me...


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
  •