|
-
PHP problem
I'm a beginner in PHP, and I've tried to make some code by myself. I've stubled across this problem I can't seem to solve.
When I use the line <? include("/cgi-bin/banner.cgi"); ?> I get an error msg.
Warning: Failed opening '/cgi-bin/banner.cgi' for inclusion (include_path='./:/usr/local/lib/php') in /home/outerfx/outerfx-www/banner.php on line 1
It seems as if the PHP thingie doesn't know how to read from root with /. How do I define this, so that it will be correct?
To use /cgi-bin in HTML works fine, why?
-
Ursus Arctos Moderatis
Where exactly is your cgi-bin in relation to the banner.php document?
Lemme guess...
cgi-bin is here:
/home/outerfx/cgi-bin
and as it showed in your code, banner.php is here:
/home/outerfx/outerfx-www/banner.php
So...here's how I would include "banner.cgi"
<? include("../cgi-bin/banner.cgi"); ?>
Should work...I *think*
-
Yes, that would work if the file I put <?include("../cgi-bin/banner.cgi"); ?> in, is in /home/outerfx/outerfx_www, but I'm using header and footer files for the layout, and all the files retrieve from them, so therefore if the file is in f.ex. /home/outerfx/outerfx_www/things it won't work.
Shouldn't there be a way to specify the include_path variable or something?
[This message has been edited by Trophy (edited January 26, 2001).]
[This message has been edited by Trophy (edited January 26, 2001).]
-
Ursus Arctos Moderatis
Hmmmmm, I've flipped through my book and can't seem to find an include command that starts itself at the rootweb. I know that this is easily done in SSI, but we're lookin' at PHP here....and I'm stumped. I'm *sure* there's a way to do it in PHP, but my limited knowledge of the language prevents me from seeing it. Sorry buddy, and good luck.
-
Well, well... we're at the point where we really need more programmers in here, again...
I guess I'll have to find out a way to get around this problem, though I doubt I'll get any way with it.
Know anywhere else I could look or ask?
-
It wasn't really a big problem.
All I had to do was include the whole root path.
So instead of just /cgi-bin/banner.cgi it would be /home/outerfx/outerfx-www/cgi-bin/banner.cgi
Thanks anyways.
-
Ursus Arctos Moderatis
Well....how in the world does the PHP script know weither to interpret the include as a relative link, or an absolute link? I've only used them with relative links...so naturally I assumed that that's how they worked.
-
Reef Shark
Originally posted by Grizzly:
Well....how in the world does the PHP script know weither to interpret the include as a relative link, or an absolute link? I've only used them with relative links...so naturally I assumed that that's how they worked.
Well with absolute linking at least on the server side couldn't you just give the location right from the c:/ to the file?
------------------
Kill em all and let God sort'em out.
WoU
Orc, 6.3k acres
God damnit, better graphics != revolutionary gaming! Get it through your skull!
-
Ursus Arctos Moderatis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|