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

Thread: Variables wont carry through includes

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry. Im really not very good at php yet. Im new.
    So what do I put in my php.ini file if my includes path is http://www.finalfantasyfan.net/includes/

  3. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's a local path, not an URL.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #14
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Do I have to include php.ini?

    Code:
    <?php
    // Works as of PHP 4.3.0
    set_include_path('/home/noth/public_html/includes');
    
    // Works in all PHP versions
    ini_set('include_path', '/home/noth/public_html/includes');
    ?>
    i didn't include it but had this and it didn't work. When i went into a sub folder the includes were messed up.

  5. #15
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm not surprised.
    Try:
    Code:
    $seperator = ":"; // ; for Windows, : for anything else
    set_include_path(get_include_path() . $seperator . '/home/noth/public_html/includes');
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #16
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I put that in my php.ini file and then went on to my index.php in the folder 't' and it wouldn't work:

    Code:
    Warning: main(includes/maincore.php): failed to open stream: No such file or directory in /home/noth/public_html/t/index.php on line 11
    
    Fatal error: main(): Failed opening required 'includes/maincore.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home') in /home/noth/public_html/t/index.php on line 11
    Twey. Have you got AOL or MSN?

    By the way mate, you've been a great help, thank you a lot

  7. #17
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Twey. Have you got AOL or MSN?
    Happily, no.
    Firstly, that wasn't meant to be in your php.ini file, it's PHP code. If you want to use php.ini, find the line beginning "include_path" and add :/home/noth/public_html/includes to the end of the value.

    Secondly, there'll be no need to specify the directory; it would simply be require_once('maincore.php').
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #18
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok thannk you - it worked. Wouldn't work in php.ini so I put that code at the top.

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
  •