You are here: Re: how to reference other files? « All PHP « IT news, forums, messages
Re: how to reference other files?

Posted by J.O. Aho on 11/25/05 12:25

moriman wrote:

> The script I'm using is located (browser-wise) at http://home/test.php,
> isn't a file in the same directory classed as being in the 'local'
> filesystem?

No, you are going through the webserver, which isn't a local filesystem, it's
remote, no matter if the server is running on your machine or someone elses
machine.

>>> $filename3 = "title.php";
>> only true if the file is in the same directory where executed.
>> When executed through a webserver, then it's relative to the location of
> the
>> script.
>>
>
> again, as above, it *is* in the same directory

If your prompt in the dos-console say:

c:\

and the file is in

c:\xitami-25\app\public_html

and you execute the file

php.exe c:\xitami-25\app\public_html\test.php

then you are executing the script from another location than where the script
is located, which makes that the file title.php isn't found as it's not in c:\

but if you change directory so that you are in

c:\xitami-25\app\public_html

and execute the script with

php.exe test.php

then you have the file test.php in the same directory where you execute the
php and then you can find the file.


//Aho

 

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

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