|
Posted by Sandman on 11/16/05 17:22
In article <437b23d2$0$27941$892e7fe2@authen.yellow.readfreenews.net>,
MBS <mbs@mbs.net> wrote:
> "Rik" <luiheidsgoeroe@hotmail.com> wrote in news:dlf7km$6fa$1
> @netlx020.civ.utwente.nl:
>
> > MBS wrote:
> >> I am playing around with some PHP code. I want to put in an include()
> >> function so I can include existing HTML code and output it to the
> >> browser.
> >>
> >> Lo and behold PHP does not support relative paths with the include()
> >> function!
> >
> > It does, works perfectly here in PHP4 and PHP5.
> > Search your code for errors.
> >
> > Grtz,
> >
> > Rik
> >
> >
> >
>
> No, it does not work.
>
> I have a file in the directory of the currently executing php code. One
> would assume the following would work:
>
> include 'myfile.hmtl';
>
> But it does not work.
>
> I'm using PHP5 on WinXP and Apache 2.
If that's cut'n'paste from your script, then you have a typo in the extension.
Other than that, PHP can be set not to use "." for include dir - check your
php.ini for your include dir. Even then, files earlier in the include path
supersedes later ones, so if you have a "myfile.html" earlier in the paths it
will be included instead of the relative one.
--
Sandman[.net]
Navigation:
[Reply to this message]
|