You are here: Re: 'undefined function' error if I use a fully-qualifed include « PHP Programming Language « IT news, forums, messages
Re: 'undefined function' error if I use a fully-qualifed include

Posted by Oli Filth on 10/18/05 20:43

Puzzled said the following on 18/10/2005 17:54:
> This is a weird problem, but perhaps someone else has seen it before
> (I hope!)
>
> If I use a fully qualified include call
>
> include ( 'http://localhost/subtree/filename.php')
>
> I get an 'undefined function' error when calling a routine that's
> defined in that file.

AAARGH! This question comes up practically every week!

This is an absolute *HTTP* URL, not an absolute *filesystem* URL. So it
obtains filename.php by performing an HTTP request to the specified
server, which just happens to be "localhost" in this case.

And of course, a server set up to parse and execute PHP files will parse
and execute filename.php when it's requested, so all your include() call
sees is the output result of filename.php.



--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация