1

Topic: Using extern.php in main.tpl

I have a problem getting output from extern.php when including it in the main.tpl.
There is no output whatsoever.
I tried a simple

<?php include('http://www.site.com/forum/extern.php?action=stats'); ?>

but that didn't work.
So I read a little in this forum, and decided to try the pun_include, and I put this code in main.tpl:

<pun_include "http://www.site.no/forum/extern.php?action=stats">

But that didn't work either. What am I doing wrong?

I read through a bunch of other threads regarding extern.php, but couldnt find the answer hmm

2 (edited by CodeXP 2005-09-09 07:26)

Re: Using extern.php in main.tpl

Endre wrote:

I have a problem getting output from extern.php when including it in the main.tpl.
There is no output whatsoever.
I tried a simple

<?php include('http://www.site.com/forum/extern.php?action=stats'); ?>

but that didn't work.
So I read a little in this forum, and decided to try the pun_include, and I put this code in main.tpl:

<pun_include "http://www.site.no/forum/extern.php?action=stats">

But that didn't work either. What am I doing wrong?

I read through a bunch of other threads regarding extern.php, but couldnt find the answer hmm

There are a few problems doing this that way..

1. Included files by using <pun_include> is that those files should always be located in ./include/user/
2. Passing GET values to an URL doesn't always work.. What you've done here will work, but any additional parameters may cause you some headaches.

What you could do, is just create a new .php files in the include/user folder, that in turn includes the extern.php file.

Re: Using extern.php in main.tpl

extern.php is meant to be included externally (hence the name).

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Using extern.php in main.tpl

Endre wrote:

I have a problem getting output from extern.php when including it in the main.tpl.
There is no output whatsoever.
I tried a simple

<?php include('http://www.site.com/forum/extern.php?action=stats'); ?>

but that didn't work.
So I read a little in this forum, and decided to try the pun_include, and I put this code in main.tpl:

<pun_include "http://www.site.no/forum/extern.php?action=stats">

But that didn't work either. What am I doing wrong?

I read through a bunch of other threads regarding extern.php, but couldnt find the answer hmm

Here is a fix. In include/user make a script called for example _extern.php
For example:

<?php include "http://community.webzine.se/extern.php? … amp;fid=13";?

Then in main.tpl include
For example:

<pun_include "_extern.php">

5

Re: Using extern.php in main.tpl

Thanks Patrick for the solution and other answers as well, it worked like a charm big_smile