Topic: Trouble integrating extern.php

Hi, I've tried searching this forum to find a solution to my problem without success.
So now I'm turning to you guys with my problem.

I'm trying to integrate latest activities from the forum on my site located at http://www.swedenrocktelge.com/main2.php , note that this is the test page witch is not visible to other visitors.

I've tried the different <?php include('... and <?php require('... that are suggested here without any success.

The only way that extern.php works for me if i go directly to http://www.swedenrocktelge.com/forum/ex … amp;show=5

When I try to include extern.php to my main2.php page I get the following error message:

Warning: main(./forum/extern.php&action=active&show=5): failed to open stream: No such file or directory in c:\IIS_Automation\LocalUser\xxxxxxxx\main2.php on line 86

Warning: main(): Failed opening './forum/extern.php&action=active&show=5' for inclusion (include_path='.;c:\php4\pear') in c:\IIS_Automation\LocalUser\xxxxxxxx\main2.php on line 86


Server info from Statistics:
PunBB version:   PunBB 1.2.5 - Check for upgrade
© Copyright 2002, 2003, 2004, 2005 Rickard Andersson
Server load:   Not available (1 users online)
Environment Operating system:   WINNT
PHP:   4.3.8 - Show info
Accelerator:   N/A Database MySQL 4.0.20a-nt

2 (edited by Ludo 2005-05-13 13:39)

Re: Trouble integrating extern.php

have you tried that?

<?php
$ancien_get_action = $_GET['action'];
$ancien_get_show = $_GET['show'];
$_GET['action'] = 'active';
$_GET['show'] = 8;
include($_SERVER['HTTP_RACINE'] . '/forum/extern.php');
$_GET['action'] = $ancien_get_action;
$_GET['show'] = $ancien_get_show;
?>

I think it's a problem with punroot which is not correctly declared.

Ludo,

3

Re: Trouble integrating extern.php

You should also have a look at that http://punbb.org/forums/viewtopic.php?id=4947

Ludo,

Re: Trouble integrating extern.php

Erm, extern.php& should be extern.php? wink

Re: Trouble integrating extern.php

davidian use what ludo said as a last resort, first try the include with the full http://www.... before it

e.g.

<?php include "http://www.swedenrocktelge.com/forum/extern.php?action=active&show=5"; ?>

Re: Trouble integrating extern.php

Sorry bout the extern.php& foulup, simple typo from my side.
Tried Connorhd's suggestion without success...still getting the same error messages.

Ludo's code gives the following errors:

Notice: Undefined index: action in c:\IIS_Automation\LocalUser\xxxxxxx\main2.php on line 87

Notice: Undefined index: show in c:\IIS_Automation\LocalUser\xxxxxxx\main2.php on line 88

Notice: Undefined index: HTTP_RACINE in c:\IIS_Automation\LocalUser\xxxxxxx\main2.php on line 91

Warning: main(/forum/extern.php): failed to open stream: No such file or directory in c:\IIS_Automation\LocalUser\xxxxxxx\main2.php on line 91

Warning: main(): Failed opening '/forum/extern.php' for inclusion (include_path='.;c:\php4\pear') in c:\IIS_Automation\LocalUser\xxxxxxx\main2.php on line 91

Checking phpinfo.php for more PHP settings info next.

Re: Trouble integrating extern.php

Thanks for your help, but I think we'll just have to do without that block on our frontpage.
I'll look back here for more hints and tips later this weekend.

Re: Trouble integrating extern.php

Should be ./forum/, not /forum/