Reply to Re: Very basic question

Your name:

Reply:


Posted by J.O. Aho on 10/10/27 11:39

m6s wrote:
> I'd like to make my database variables globally available through a
> class OR global values where this file would be included and so the
> variables would be seen from any script that I run.
>
> Can someone tell me the way?

make a file, let call it database.php

in your database.php you store the variables/class you want, eg

<?PHP
$database_user='root';
$database_pass='1234';
?>

Then in all the scripts you want to use these variables, you add this line
before you use them

include_once('database.php');

or even better one with a full path to the file

include_once('/var/www/localhost/database.php');

After this, you can use the variables $database_user and $database_pass with
the values set in your database.php.


//Aho

[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

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