I did something similar between different virtual servers on the same
physical server by using a directory outside the local html directory.
EG using :
PHP Code:
require_once("/usr/local/mysites/head_cont.php");
But how would I do it between different servers ?
Javascript can pull code off any website and use it,
can php do a similar thing by using the url to get the php file
and then include it ?
Thanks.
.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
Of course it can be done - if he sets the proper permissions and has the proper login and acess credentials for servers and script at each end.
Hell, he can even use FTP to get the local file and save it to a local folder. Using PHP and FTP with ftp_get(). Actually, it's easier to use ftp_get() then just call the newly saved file instead of sever configurations that will leave a huge gaping security hole.
__________________
For professional Hosting and Web design.....
sure, lots of things are possible, he could even use Samba and create a long range share and mapping of the remote device, but again bad security, not the proper way to accomplish this and not what any experienced developer would call any elegant solution.
True, but the man doesn't want to interchange info, he wants to be able to include PHP code not available locally. SOAP won't do that for you mate. Elegant yes, but not the solution.
He wants a simple include('file_to_be_included.php').
And how is using PHP's FTP usage hacky and dirty? Its in the core of the PHP language and only needs 3 lines of code to implement such functionality.
__________________
For professional Hosting and Web design.....
Hmm...it actually can. Call another page that will read the.php files contents and then send it to the calling php file. Yeah. I must have just zoned out when you said:
Code:
"this can't be done, PHP is a server side language. have a look at PHP SOAP web services. "
Maybe there's a SOAP functionality thats more native than the one I mentioned. I don't use SOAP much....or at all in my line of work.
Hmpff. Haha.
__________________
For professional Hosting and Web design.....
But if the MySQL db is on a different server,
I guess I need something other than "localhost".
What should I put in there in order to ensure access ?
Thanks
.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
Yes, Remote MySQL is just like normal except no localhost for hostname. You use something like...
PHP Code:
$host = "http://mysql.remotedomain.com"; //its not always mysql.balhblah.com can be 2.remotedomain.com or http://remotedomain.com/mysql depends on hostname configured
First, you need to make sure that your host provides remote MySQL acess. Most free hosts don't provide this.
You ussually have a hostname where you login fo phpmyadmin and such. Most hosts give this for use in scripts. e.g mysql.yourdomain.com . Just check with your host the subdomain or path for MySQL access.
__________________
For professional Hosting and Web design.....
yes, if the ports are open on your firewall/router and your MySQL server is configured correctly to bind to any local address then yes, you can connect to the MySQL server from anywhere.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.