RE: [PHP-DEV] mysql_connect

From: Date: Mon, 02 Oct 2000 21:03:21 +0000
Subject: RE: [PHP-DEV] mysql_connect
Groups: php.dev 
Request: Send a blank email to php-dev+get-34099@lists.php.net to get a copy of this message
I don't follow. I created several PHP files (with .php extensions) on my web server. There are also several .html files. A user will go to an html file (ie, index.html) which will have a link to do something database related (ie retrieve data, update/add data). This takes them to a PHP page. This PHP page not only contains the code to perform the task (retrieve, update, add data) but also the connection information for PHP to connect to the MySQL server. Given that I am new to PHP, it wouldn't surprise me that I am not doing this properly. Should I not direct people to these PHP pages? How else can I accomplish this? -----Original Message----- From: Peter Korsgaard [mailto:jacmet@control.auc.dk] Sent: Monday, October 02, 2000 1:50 PM To: Michael Conley Cc: 'php-dev@lists.php.net' Subject: Re: [PHP-DEV] mysql_connect On Mon, 2 Oct 2000, Michael Conley wrote: > [..] How can I make the connection to the MySQL database > in some other page or otherwise not expose the connection information? First of all it normally isn't possible to view the sourcecode of the PHP script, since you only see the output of running the script. But ofcause someone might find a bug in PHP (like there was in ASP some time ago), so you might secure your script by using include to include a script outside of your document root containing the username/password for mysql. Alternative you can set variables in your apache conf which can be read by your PHP scripts. -- Bye, Peter Korsgaard

« previous php.dev (#34099) next »