- Title: New member
- Status: Offline
- Registered: 2008-07-03
- Posts: 2
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!
Last edited by farser (2008-07-04 14:10:54)
- Title: Senior Member
- Status: Offline
- From: USA
- Registered: 2006-02-22
- Posts: 1688
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 !!!
- Title: New member
- Status: Offline
- Registered: 2008-07-03
- Posts: 2
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!
- Title: Senior Member
- Status: Offline
- Registered: 2004-10-07
- Posts: 303
Re: Simple PHP problem?
You can include it from your own domain easily, I don't know what your on about quaker 
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
Last edited by Reines (2008-07-03 19:43:55)
- Title: Senior Member
- Status: Offline
- From: USA
- Registered: 2006-02-22
- Posts: 1688
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 !!!
- Title: Senior Member
- Status: Offline
- Registered: 2004-10-07
- Posts: 303
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()).
Posts [ 6 ]
Guest posting is disabled. You must login or register to post a reply.