Hi Roddie,

The require or include functions will do this for you, see
http://www.php.net/manual/en/function.include.php

Paths are absolute to the file system, not where the web server path starts,

eg suppose your file is at
/usr/home/www/riddie/phpscripts/somedir/script.php

you would include a file (into script.php) from the phpscripts directory
using either

require('/usr/home/www/riddie/phpscripts/myincfile.php')
or
require('../myincfile.php')

but
require('/phpscripts/myincfile.php') would not work as php does not work
from paths set by the webserver.

HTH,

Kevin


Roddie Grant <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm new to PHP, but from Lasso I'm used to the following sort of
arrangement
> (in pseudo-code)
>
> Search for matching records
> If number found=1
>   include "/folder/subfolder/file1"
> If number found>1
>  include "/folder/subfolder/file2"
> If number found=0
>  include "/anotherfolder/subfolder/file99"
>
> where the included file contains the appropriate code for displaying a
list,
> a detailed record etc. In fact the whole page is made up almost entirely
> from a succession of included files.
>
> The paths all "hang" from the root as with HTML (for example <img
> src="/images-folder-at-root-level/image.gif">).
>
> In PHP the include_path stops this process in its tracks. I'm with an ISP
so
> I don't suppose I can control include_path (.:/usr/local/lib/php). Are
there
> any other options?
>
> TIA
>
> Roddie Grant
> [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to