include function php

include function php

Posted by: kiko08
Posted on: 2007-07-24 17:33:00

hi iam having troubles with my forum punbb.
i tried to include the extern.php to show the last 10 post made. but im having error in including the file and im very confident that its bec of the way my php was install on my server.

this is the error ive got

Warning: main(extern.php?action=active) [function.main]: failed to open stream: No such file or directory in /home/.shamrock/myusername/mywebsite.com/forum/header.php on line 219

Warning: main(extern.php?action=active) [function.main]: failed to open stream: No such file or directory in /home/.shamrock/myusername/mywebsite.com/forum/header.php on line 219

Warning: main() [function.include]: Failed opening 'extern.php?action=active' for inclusion (include_path='.:/usr/local/lib/php') in /home/.shamrock/myusername/mywebsite.com/forum/header.php on line 219

Re: include function php

Posted by: username
Posted on: 2007-07-24 18:16:00

I am not sure that you can pass the action value in the file path. I've never heard of doing that before, but I don't have a very good understanding of files in Linux so I guess there it is possible that it would work, but I would still try it without and see if just 'extern.php' works instead.

Re: include function php

Posted by: kiko08
Posted on: 2007-07-24 21:59:00

it still not work. even with extern.php only.

Re: include function php

Posted by: misterhaan
Posted on: 2007-07-25 07:22:00

?action=active is handled by apache, but when you do an include() in php, especially with allow_url_fopen disabled, you're not using apache. if $_GET['action'] isn't already set to active, but the included script needs it to be, just set it before including the script, and leave off the ?action=active.

track7 - my dream-hosted site

Re: include function php

Posted by: Lethosos
Posted on: 2007-07-25 09:57:00

Indirectly, you may have to call up a stored mySQL entry just to pass whatever you need to pass into the external code.

But I don't think you need to do it--as long as the the fuctions in the external code has some form of variable passing in its call, it'll pick it up when called and a simple 'include ("external.php");' statement added.

Tags: header phpmywebsiteopen streampunbbiveinclusionlibusr