I have a mainwebsite and a subdomain. They both have different databases, config files, … The file getinfo.php in my subdomain gets the numbers of active topics. What is the best way to display this on my homepage? How can I execute the getinfo.php, get that data and display it on my homepage? Or is there another possibility to do that?
I think it is not a good idea to connect to a second database.
I don’t know why you’re opposed to connecting to multiple databases simultaneously. But, if you’re so flatly against it then I’m sure you have a good reason to be. A hacky solution would be to write a page on the subdomain to provide the data from the database you don’t want to connect to via some easily-parsable method, like
serialized string, JSON, or XML. Then, use cURL on your other page to fetch this data. There are obvious security concerns that you’ll have to account for, such as how you’ll ensure the other page isn’t accessed by anything but your script.