You are here: Re: variable in include « PHP Programming Language « IT news, forums, messages
Re: variable in include

Posted by ZeldorBlat on 05/10/07 19:21

On May 10, 2:59 pm, SterLo <sterling.hamil...@gmail.com> wrote:
> If you define a variable $x and then INCLUDE a file such as
> include_once("path"); it should work.
>
> So if you have:
>
> $query = 'select * from list where content = '.$idcontent;
>
> And
>
> $idcontent = 15;
> require_once("queries.inc.php");
>
> You need to change require to include.
>
> so it should be
>
> $idcontent = 15;
> include_once("queries.inc.php");
>
> And you can check this by doing something like
>
> if ( $idcontent > 0 ) {
>
> }

Not true -- require and include behave identically in every way except
for what happens when the file cannot be included for some reason.

<http://www.php.net/require>

 

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

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