I've got a mainwebsite along with a subdomain. Both of them have different databases, config files, ... The file getinfo.php during my subdomain will get the amounts of active subjects. What's the easiest method to display this on my small home page? How do i excecute the getinfo.php, have that data and display it on my small home page? Or perhaps is there another posibility to achieve that?

It is not recommended for connecting to some second database.


For those who have 2 databases you cannot do apart from connect with the two databases. And when they're on a single server you will not have that much overhead

I'm not sure why you are in opposition to hooking up to multiple databases concurrently. But, if you are so flatly against after that it I am sure you've got a valid reason to become. A hacky solution is always to write a webpage around the subdomain to supply the information in the database you won't want to connect with via some easily-parsable method, like serialized string, JSON, or XML. Then, use cURL in your other page to fetch this data. You will find apparent security concerns that you will need to take into account, for example how you'll make sure the other page is not utilized by not your script.

Send a cURL request out of your home page to some PHP file in your subdomain that can take that cURL request and results the HTML for the top posts. Then just echo the $creation of the cURL.