You are here: Re: [PHP] Bug or programmer-error? « PHP « IT news, forums, messages
Re: [PHP] Bug or programmer-error?

Posted by Frank de Bot on 08/06/05 18:19

Rob Ziere wrote:

>Dear PHP_friends,
>
>
>
>I have found a strange behaviour of the "include" function.
>
>
>
>Here it is .
>
>
>
> // 1. this works fine
>
> include ("../../gps_info/fetch_fields.php");
>
> // 2. this works fine
>
> $doc_root=$_SERVER[DOCUMENT_ROOT];
>
> include
>("$doc_root"."/pages/gps_info/fetch_fields.php");
>
> // 3. this open the doc fetch_fields.php allright, but variables
>that have been set outside fetchfields.php are not available within
>fetch_fields.php
>
>

You could try calling a var with global first

global $variable

(reference: http://nl2.php.net/global )

> $root= 'webserver-2';
>
> include
>("$root"."/pages/gps_info/fetch_fields.php");
>
>
>
>
>
>Does anybody have a clou as to what's wrong here?
>
>
>
>
>
>Best regards/ Met vriendelijke groet,
>
>Rob Ziere
>
>Webmaster/beheerder GO-GPS.nl, alles over GPS en wandelen
>
>http://www.go-gps.nl
>
>
>
>
>
>
>
>

 

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

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