Access main htdocs from subdomain in PHP

Hi, how can I access the main domain from a subdomain in PHP, I’m trying “…/…/htdocs/” without success. Is there any way to do this?

I´m running some php from a subdomain to create files in the main domain htdocs.

Hi and welcome to the forum

For security reasons, websites on InfinityFree are restricted to only access the files in their own website directory. This helps to make sure that if someone or something were to obtain unauthorized access to your website, they would not be able to harm your other sites.

Because of this, it’s not possible for one website to write files to the folders in another website here.

Every PHP script can only access the files in its own website directory


Redirecting to the main domain isn’t allowed BUT you can use an iframe.
The iframe lets you viewand interact with the main domain.

you can also use width="100%" and height="100%" to fill the webpage.

why not?

Tried it once and i got 3 accounts suspended

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.