Re: Include File Syntax

From: Date: Fri, 27 Apr 2001 14:13:56 +0000
Subject: Re: Include File Syntax
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8945@lists.php.net to get a copy of this message
Hi, This is a small example to connect the Database. <? function dedb_connect() { $link = mysql_pconnect("localhost","login","pass"); if ($link && mysql_select_db("DBname")) return($link); return(FALSE); } ?> and save as "dedb.inc" And Then, in your php. file Before you start any statement or query. put this on first. <? include ("dedb.inc") .......... ..........your other query........ ?> OK... Kelvin. ""James McLaughlin"" <katana@montrose.net> wrote in message news:000801c0ce20$9ab1e900$2200a8c0@darkjustice.net... > This is my first time programming with PHP. I have seen include files in > the beginning of a php block and wonder is there a specific syntax used in > these files and how secure this is vs code in my .php page? > > Can someone show me a small example of what the include file might look like > that would contain variables for $mysql server, $username $password and > $db_name. > > Any comments you may have about security involving files containing these > variables and where to store them would be greatly appreciated. > > > > Thanks In Advance. > > > Kat > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#8945) next »