Re: PostgreSQL and PHP
| From: | fabrizio dot ermini at sysdat dot it | Date: | Tue, 21 Nov 2000 17:08:32 +0000 |
| Subject: | Re: PostgreSQL and PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4614@lists.php.net to get a copy of this message | ||
> $conn = pg_connect("host=hostname user=username password=password dbname=dbname");
>
> This is working great, but what I would like to do is set up an login ini file, so that my
> username and password aren't as easily accessable. I've been experimenting with my MYSQL
> ini file, but lack the experience with PHP to get it going. Can anyone supply me with a URL to a
> website that
details this proccess? Or sample code if it isn't too much trouble?
>
What do you want to do exactly? I mean, hiding your connection
info from other site hosted on the same computer (if you're on a
provider host) or from site users?
Since PHP is server side, end user never sees code so your
account info are safe. If you want to simply take them off from your
web directory, you can use a include() or require() statement to get
a file containing the pg_connect instruction from another directory
(you can select it with the php_include_path option in the
configuration file) . However, this directory
must be readable from the http server process, so it's simply
"hidden", not "protected", if you know what I mean.
HTH, bye
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini@tin.it
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini@sms.tin.it