Mehran Ziadloo wrote:
> It's about 'include' function, I can't include a php file using an
> absolute address. For example, all my pages are in
> "D:\Inetpub\wwwroot". And when I want to include a page with the
> address:
>
> "D:\Inetpub\wwwroot\includes\a.php"
>
> with the command:
>
> "include '/includes/a.php';"
>
> it can't be done, it says:
>
> Warning: main(/includes/a.php) [function.main]: failed to create
> stream: No such file or directory in D:\Inetpub\wwwroot\index.php on
> line 2
>
> Warning: main() [function.main]: Failed opening '/includes/a.php' for
> inclusion (include_path='.;D:\Inetpub\wwwroot') in
> D:\Inetpub\wwwroot\index.php on line 2
>
try like this:

include ('includes/a.php'); //without slash at the beginning

The slash at the beginning has a special meaning on all *nix systems (it's
the system root). You must not confund file system paths which you use in
PHP scripts with link paths in HTML (i.e. <a
href="/mainpage.html">Homepage</a>).

Christoph



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

Reply via email to