1 (edited by farser 2008-07-04 14:10)

Topic: Simple PHP problem?

I am trying to show information on my homepage about the forum using the developers manual and PHP. I have been able to do this before with ssi but needed to change it to PHP.




How do i solve the error shown on the test page above?
The code i am using is: 
<?php include(forum/extern.php?action=stats);?>


Is this wrong?

any help would be gladly accepted!

Re: Simple PHP problem?

you cant use
<?php include(forum/extern.php?action=stats);?>

in your own website..
the extern.php has issue...

only way i know would be to create a file on a different host and then point to that file.
http://yoursite.com/test.php

then do a include from that site.  sorta a bounce around .. that might work.....



Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Simple PHP problem?

Thanks for the quick reply!

ahh well that is a problem! Is there any way to have server side include and php on the same page? Because on the page i want it on i have php showing upcoming events!

4 (edited by Reines 2008-07-03 19:43)

Re: Simple PHP problem?

You can include it from your own domain easily, I don't know what your on about quaker tongue

The problem is A) You need ' marks around a string, and B) You need to use the http wrapper rather than file wrapper by specifying the full path, ie:

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

Alternatively if you wish to do some processing on the output rather than simply include it:

<?php

$stats = file_get_contents('http://www.example.com/forum/extern.php?action=stats');

// do something to $stats

Re: Simple PHP problem?

Reines, i didnt know that... kewl.. thanks ill have to try that.

now what about the ending tag?

?>

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Simple PHP problem?

quaker wrote:

now what about the ending tag?

?>

Where, in the second example? I left it out to imply the script probably wouldn't finish there, though it doesn't matter anyway, the ending tag is optional (unless it's code within eval()).