1

Topic: Error with an include script

On my forums, I have the sidebar and all of that.  One of the boxes uses and include to a small script to show the active topics.  Pulled it right from somewhere linked off of here...nothing special.

I've had it give me a few errors before in the past, but they were there and then just went away so I assumed it was a server issue. I'm getting an error on that box now though and it's been there for 3 days now. Not going away. The rest of the site works just fine. It's just this one little bit.  This is the error I am getting:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /server data blah blah blah/ngl/include/user/atopic.php on line 6

Warning: include(http://ngl.gamersides.com/extern.php?action=active&show=5) [function.include]: failed to open stream: no suitable wrapper could be found in /server data blah blah blah/ngl/include/user/atopic.php on line 6

Warning: include() [function.include]: Failed opening 'http://ngl.gamersides.com/extern.php?action=active&show=5' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /server data blah blah blah/ngl/include/user/atopic.php on line 6

Any ideas on what might be wrong?

Re: Error with an include script

Your server disabled it tongue
Try using cURL.

3

Re: Error with an include script

I read that in there...but just passed it off since it had done this before and then a day or two later, it came back up with no issues. I'll have to contact my server admin I guess and see what's up.  I don't see any reason why it was disabled.

Re: Error with an include script

My guess is they just upgraded to PHP 5.2.0 which disables allow_url_include by default

Re: Error with an include script

Just in case anyone missed it. As it caused me 4 hours of hair pulling

<?php
//use constant MY_URL so no one includes $their_url
define('MY_URL', 'http://mysite.com/forumpath/');
@curl_exec(@curl_init(MY_URL."extern.php?action=active&show=10"));
?>

6

Re: Error with an include script

Jonbouy wrote:

Just in case anyone missed it. As it caused me 4 hours of hair pulling

<?php
//use constant MY_URL so no one includes $their_url
define('MY_URL', 'http://mysite.com/forumpath/');
@curl_exec(@curl_init(MY_URL."extern.php?action=active&show=10"));
?>

I put this in and changed the link to my site, but it doesn't produce anything on my page.  It's just blank.  Could anyone help me out with what I might have done wrong or is there something else to add to this code?

This is the code sitting in my main.tpl to try to get this to work. Again, I got the box, but there's no info.

<div class="block">
        <h2 class="block2"><span>Active Topics</span></h2>
        <div class="box">
            <div class="inbox">
                <?php
                //use constant MY_URL so no one includes $their_url
                define('MY_URL', 'http://gamersides.com/ngl/');
                @curl_exec(@curl_init(MY_URL."extern.php?action=active&show=5"));
                ?>
            </div>
        </div>
    </div>

Re: Error with an include script

You can't put PHP directly in a template file. Take a look at the docs on pun_include

8

Re: Error with an include script

yes as smartys said you must place that code in a file and put that file under include/user and then use this code inside of the box:

<pun_include "filename.php">

9

Re: Error with an include script

ahaha.  I feel stupid and should have known that.  I mean...I as already using the include in the first place.  ahahaha...thanks guys.