Remote MySQL connection via PHP file
| From: | Scott | Date: | Fri, 01 Dec 2006 18:17:58 +0000 |
| Subject: | Remote MySQL connection via PHP file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245414@lists.php.net to get a copy of this message | ||
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 "http://www.remoteserver.com/remote_file.php";
// Use variables $user and $pass somehow...
?>
I've tried including the file which has the username/pass, etc information via HTTP, but this doesn't seem to work. I assume because it returns what a web browser would return if this file was loaded into one, a blank screen.
I've tried using the return statement in the file which houses the information, but this seems to return a boolean value (1 or 0)... not sure what's up with that.
Any help with this would be most appreciated.
Thank you.
Scott