For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > July 2004 > import external php file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author import external php file
Pedro Amaral Couto

2004-07-31, 3:55 pm

Hi;
Is it possible to import an external php file
( something like C++ "#include" or Java "import" ) ?

Regards!

Sebastian Lauwers

2004-07-31, 3:55 pm

Pedro Amaral Couto wrote:
> Hi;


Hi

[...]
> ( something like C++ "#include" or Java "import" ) ?


include();

http://fr2.php.net/function.include

Best regards,
Sebastian
steve

2004-07-31, 8:55 pm

"Sebastian Lauwers" wrote:
> Pedro Amaral Couto wrote:
>
> Hi
>
> [...]
>
> include();
>
> http://fr2.php.net/function.include
>
> Best regards,
> Sebastian


Just be careful that include’ing a file is relative to the top calling
script, not relative to the immediate calling script!

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-import-...pict135259.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=451809
Colin McKinnon

2004-07-31, 8:55 pm

steve spilled the following:

> "Sebastian Lauwers" wrote:
>
> Just be careful that include’ing a file is relative to the top calling
> script, not relative to the immediate calling script!


Only if you have '.' in your include path.

There are actually four functions which handle this directly:
include()
include_once()
require()
require_once()

In most cases it's the last one you really want.

C.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com