Brad Fuller wrote:
Miguel -
If my solution is not viable, is there any other way of hosting my
files someplace else, but still access the local database?
Yes. Your remotely hosted code would call the database on your local
server. Something like:
<? $link = mysql_connect("foo.com", "bar", "PASSWORD"); ?>
You would also need to allow the connection from the remote host in mysql.
mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';
If you don't want to expose your database directly to the internet, you
could have a PHP intermediary service - your local code could be limited
to one PHP script that would enforce HTTP authentication (over https to
maintain security), and could forward SQL queries and responses from the
database. Your remote code could call the local intermediary service.
I personally don't understand why you'd need to store code remotely but
execute it locally, unless you're concerned about the office "stealing"
your code, or using it without permission...If you aren't concerned
about code theft, there are lots of ways you could store code remotely,
e.g. a very raw/simple/uncomplicated/ugly:
$src = file_get_contents('http://server/code.php.txt');
file_put_contents('/tmp/code.php',$src);
include('/tmp/code.php');
unlink('/tmp/code.php');
But there are at least a few reasons why I wouldn't recommend doing that...
jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php