HI every body,

I m having a file aaa.php in my root directory(ie in my main domain) . Now i want to use that aaa.php in my subdomain.How can i point that file from subdomain to main domain.
Just i am giving the full path <?php include("http://www.mydomainname.com/aaa.php")?>

The above is not working.

Please give solution
Thank you

It is possible to do by entering a relative file path. Below is an example of a file system:

htdocs
file.php
   subdomain
      index.php

Say in the above example index.php was open and index.php was the homepage for the subdomain and ya wanted to include file.php which is in the base of another domain. The following is what you would use:

include('../file.php');

So just use ../ to keep on going up a directory until you are at the htdocs then specify the folders down then the file. Simple but hard to explain.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.