Topic: Problem with pun_include and extern.php

Hello!

In forums/include/user/ I created tableau2.php in wich I put this code:

<?php define('PUN_ROOT','../../');
$_GET["action"] = "active";
$_GET["show"] = "18";
$_GET["fid"] = "9,7,12,13,8,15,16,17,18,20,4,22,23";
include("/home/www/xxxxxx/www/forums/extern.php");
?>

It's working good when I go to forums/include/user/tableau2.php.

After, in forums/include/template/main.tpl, I put <pun_include "tableau.php"> before <pun_main>... and bug! The include doesn't work any more.

Where is the problem?! sad

Re: Problem with pun_include and extern.php

It should look like this

include("/home/www/xxxxxx/www/forums/extern.php?action=active&show=18&fid=9,7,12,13,8,15,16,17,18,20,4,22,23");

and get rid of the define('PUN_ROOT','../../'); it is already defined.

Re: Problem with pun_include and extern.php

kierownik wrote:

It should look like this

include("/home/www/xxxxxx/www/forums/extern.php?action=active&show=18&fid=9,7,12,13,8,15,16,17,18,20,4,22,23");

No, that doesn't work: you can't include from the local filesystem and treat it like a URL

There's no need to define PUN_ROOT wink

Re: Problem with pun_include and extern.php

It doesn't work.

I have forgotten to specify that I cannot use url in include (allow_include_url doesn't work good in my servor).

Re: Problem with pun_include and extern.php

So

$_GET["action"] = "active";
$_GET["show"] = "18";
$_GET["fid"] = "9,7,12,13,8,15,16,17,18,20,4,22,23";
include("/home/www/xxxxxx/www/forums/extern.php");

doesn't work? What error are you getting?

Re: Problem with pun_include and extern.php

I have a blank page.

Re: Problem with pun_include and extern.php

Make sure display_errors is enabled in your php.ini wink

Re: Problem with pun_include and extern.php

Indeed, display_errors is not activated. But I cannot modify this now.

Re: Problem with pun_include and extern.php

kierownik wrote:

It should look like this

include("/home/www/xxxxxx/www/forums/extern.php?action=active&show=18&fid=9,7,12,13,8,15,16,17,18,20,4,22,23");

and get rid of the define('PUN_ROOT','../../'); it is already defined.

instead of /home/www/xxxxxx/www/forums/ put your webadress to that file there and it should work

i use this http://kierownik.nl/extern.php?action=new&show=10

Re: Problem with pun_include and extern.php

But I cannot use url in include (allow_include_url doesn't work good in my servor).

Re: Problem with pun_include and extern.php

Without display_errors enabled it's hard to find the issue wink
I'd say try using something like this in the meantime: http://punbb.org/forums/viewtopic.php?pid=83780#p83780

Re: Problem with pun_include and extern.php

Thank you very much!
Could you tell me if it works with allow_include_url = off?

Re: Problem with pun_include and extern.php

Matthias wrote:

Thank you very much!
Could you tell me if it works with allow_include_url = off?

It ought to, that solution was posted to address that issue.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Problem with pun_include and extern.php

Yes

Re: Problem with pun_include and extern.php

Thank you!
However, I note that CURL generates slownesses.

Re: Problem with pun_include and extern.php

A little bit yes, but that's pretty much your only option atm.

Re: Problem with pun_include and extern.php

Yes! You are entirely right!!! wink

18 (edited by Matthias 2007-02-12 11:33)

Re: Problem with pun_include and extern.php

Smartys wrote:

So

$_GET["action"] = "active";
$_GET["show"] = "18";
$_GET["fid"] = "9,7,12,13,8,15,16,17,18,20,4,22,23";
include("/home/www/xxxxxx/www/forums/extern.php");

doesn't work? What error are you getting?

Fatal error: Cannot redeclare check_cookie() (previously declared in /home/www/xxxxxx/www/forums/include/functions.php:28) in /home/www/xxxxxx/www/forums/include/functions.php on line 97

Re: Problem with pun_include and extern.php

aha, makes sense smile

Re: Problem with pun_include and extern.php

I'm lost! lol hmm

Re: Problem with pun_include and extern.php

Matthias wrote:

I'm lost! lol hmm

Well, it's very simple: extern.php isn't meant to be used within PunBB, it needs to be used from a URL

Re: Problem with pun_include and extern.php

Ok! Thank you! wink