Reply to Re: remote include doesn't work with class

Your name:

Reply:


Posted by Rik on 08/01/07 16:16

On Wed, 01 Aug 2007 18:04:14 +0200, charliefortune
<google@charliefortune.com> wrote:

> I have been including local .php files in a script succesfully for a
> while. But now I want it to be a remote include i.e.
>
> include ("http://myserver.co.uk/includes/classLib.php");
>
> and I get
>
> Cannot instantiate non-existent class:
>
> I know the path is correct because if I include simply a line of text
> to echo then it works fine. Are there any issues with variable scope
> when including remote classes please ? My class definition is simply
>
> class AdminLib {
> blah blah;
> blah;
> blah;
> }
>
> do I have to declare it global or anything ? Thanks.

If the include works fine (no allow_url_fopen or the remote include
thingy): don't forget they need to start & end with php opening & closing
tags... Else it's 'just content'.

Class definitions have no scope, allthough PHP6 might have support for
namespaces.
--
Rik Wasmus

[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

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