Hi all,
I've been searching around for a while, but cannot find a solution. For
a project of mine, I need to keep the connection information to a MySQL
server database on another server.
Example remote file:
?php
$user = joe;
$pass = 1234;
?
Example local file:
?php
include
i suggest you:
database.conf (the file on another server)
host=localhost
user=test
pass=test
anothervar=anothervalue
on your script:
$temp = file(http://../database.conf);
foreach($temp as $val) {
$temp2 = explode(=,$val);
$$temp2[0] = $temp[1];
}
after that, you`ll have:
$host =
@lists.php.net
Subject: [PHP] Remote MySQL connection via PHP file
Hi all,
I've been searching around for a while, but cannot find a solution. For
a project of mine, I need to keep the connection information to a MySQL
server database on another server.
Example remote file:
?php
$user = joe;
$pass = 1234
At 12/1/2006 10:17 AM, Scott wrote:
For a project of mine, I need to keep the connection information to
a MySQL server database on another server.
I'm sure there are more efficient ways to do this, but here's a fall-back:
Write a PHP program (web service) to run on the server where the
cajbecu wrote:
i suggest you:
database.conf (the file on another server)
host=localhost
user=test
pass=test
anothervar=anothervalue
have you thought of the security implications of this, a text file with
user names/passwords, thats rather insecure I would say,
on your script:
$temp =
Scott wrote:
Hi all,
I've been searching around for a while, but cannot find a solution. For
a project of mine, I need to keep the connection information to a MySQL
server database on another server.
?php
include http://www.remoteserver.com/remote_file.php;;
// Use variables $user and $pass
On Fri, December 1, 2006 12:17 pm, Scott wrote:
I've been searching around for a while, but cannot find a solution.
For
a project of mine, I need to keep the connection information to a
MySQL
server database on another server.
Example remote file:
?php
$user = joe;
$pass = 1234;
?
7 matches
Mail list logo