Reply to Re: Newbie - PHP Include error

Your name:

Reply:


Posted by Christian Aigner on 06/22/07 08:00

Am Fri, 22 Jun 2007 07:17:40 GMT, schrieb "Amy" <amy@amy.com>:

> I have this php file called links.php. It is in a folder on my domain
> (www.domain.com/links/links.php)
>
> The file links.php has an include statement:
>
> <?php
> include('\folderc\k.php');
>
> When I run links.php, I get the below listed at the bottom of this message.
>
> If however, I place links.php in the same folder as k.php and use the
> include statement include('k.php'); it works without any errors.
>
> Would someone know what would be the correct syntax for the include
> statement so that I can place links.php in the links folder rather then
> folderc.
>
> Thank you
>
> Error message
> Warning: main(\folderc\test.php): failed to open stream: No such file or
> directory in /usr/www/virtual/userid/www.domain.com/links/links.php on line
> 6
>
> Warning: main(): Failed opening '\folderc\test.php' for inclusion
> (include_path='.:/usr/local/lib/php') in
> /usr/www/virtual/userid/www.domain.info/links/links.php on line 6
>
>

If folderc is a subdirectory of folder links try this:

include('folderc\k.php');

If folderc is on the same level as folder links then try this:

include('..\folderc\k.php');

Regards,
Christian

[Back to original 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

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