Ivan Ivković Posted February 7, 2012 Share Posted February 7, 2012 I'm making an admin so I need to be able to do this: https://admin.mysite.com Run an upload image script from a file, saves image to folder in http://www.mysite.com Image Folder Quote Link to comment https://forums.phpfreaks.com/topic/256604-is-it-possible-to-access-a-subdomain-files-from-another-subdomain/ Share on other sites More sharing options...
noober Posted February 7, 2012 Share Posted February 7, 2012 You should have no problem doing this since both sites are on the same server. Just point the save path in your php code to the right folder. Quote Link to comment https://forums.phpfreaks.com/topic/256604-is-it-possible-to-access-a-subdomain-files-from-another-subdomain/#findComment-1315457 Share on other sites More sharing options...
The Little Guy Posted February 7, 2012 Share Posted February 7, 2012 If the shared files are on the same server, and are not website files (files accessed through a browser) you should put them in sibling directory. example: /www/classes /www/a.domain.com /www/b.domain.com In apache the directory www shouldn't be accessible via browser, though a.domain.com and b.domain.com should be. Doing it like this IMO makes accessing the classes folder easy from either domain. they both could look something like this from some file: require_once dirname(__FILE__)."/../classes/SomeClass.php"; //if your server supports __DIR__: require_once __DIR__."/../classes/SomeClass.php"; If your just posting data, it doesn't matter what server. You could post data to Google if you wanted from your domain as long as you have all the right post fields. Google does a lot of processing before accepting your data but if they didn't you could post easily (if that makes sense). Quote Link to comment https://forums.phpfreaks.com/topic/256604-is-it-possible-to-access-a-subdomain-files-from-another-subdomain/#findComment-1315534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.