Jump to content

[SOLVED] Remote SQL server


Delaran

Recommended Posts

Hey guys,

 

It's been a while since I've posted here but I've got a question that I hope someone can help me with.  I'm very close to figuring out the syntax for this command, but can't seem to get it to work.  My problem is, my company has moved our admin page to an internal server so no one can tamper with it externally.  However, our database is still running externally on another server.  By figuring out this "login" or "connection" issue I'm having here, than we could even move the database to an internal site.  This is what I am using to open my db:

 

// set path of database file
   $db = $_SERVER['SERVER_ADDR']."68.178.4.77/../wantdb.sdb";
   $handle = sqlite_open($db) or die("Could not open database");

 

It returns result:

 

Could not open database

 

So I feel as if I am getting closer, maybe it has something to do with a username/password used to log in to the remote server? Anyone have a suggestion as to how or what $_SERVER command I should use? I get the feeling it is not SERVER_ADDR I should be using but I'm not sure.

 

~del

Link to comment
https://forums.phpfreaks.com/topic/54141-solved-remote-sql-server/
Share on other sites

Well, I had thought about doing that, but the problem is that the server it is currently on is available for the public to access.  We have a php page that I've created that pushes POST data to the next page "action.php", which inserts the data into the database on the external server (public server). 

 

One of my co-workers suggested putting the admin page I've created on an internal server that the public cannot access to prevent them from tampering with the database.  So, if I was to move the database from the external (public) to the internal (private), than "action.php" would not insert data correctly because the database has been moved to another server, right?

 

I tried using some of the $_SERVER functions to the action page so that it would insert the data to the remote internal server and have gotten nothing so far.  Any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.