OM2 Posted May 12, 2009 Share Posted May 12, 2009 Is there anyway I can allow one domain be able to execute PHP and make changes (write and delete files) on another domain? i.e. I have www.abc.com and www.xyz.com on abc.com, i have code that will create a file when it is passed a path i want to be able to pass a path like xyz.com/myfiles/ How do I do this? Does that make any sense!? Thanks OM Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/ Share on other sites More sharing options...
allworknoplay Posted May 12, 2009 Share Posted May 12, 2009 Yeah you can do this, you just need to provide an account for domain 1 to access the pages on domain 2 to make changes. It's really no different than giving a user access to make changes.... Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832748 Share on other sites More sharing options...
OM2 Posted May 12, 2009 Author Share Posted May 12, 2009 account? erm... apologies, i'm a future pp master, but right now am a just more than a newbie can u say a little bit more about what this means? in a bigger project, creating an account means having some sort of subscription system? are there any ready made code that i could use? let me know thanks Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832759 Share on other sites More sharing options...
allworknoplay Posted May 12, 2009 Share Posted May 12, 2009 Well the account was just for security purposes. I mean for what you're doing, you can make it really simple just to test things out. So for ABC your code would have it check what GET data comes in like: $_GET['account']; Then say that 'account' needs to be: Prez123 in order to allow changes to be made. Then on XYZ, you pass it the account info and the file name or path...let's say file name. So XYZ would post to ABC with www.abc.com?account=Prez123&filename=myfilename This is REALLY a hack way of doing things and I really kinda regret even typing up this kind of method.... You should look into CURL, and have it post data to ABC.com Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832763 Share on other sites More sharing options...
OM2 Posted May 12, 2009 Author Share Posted May 12, 2009 thanks for the reply well... i want to do it the proper way... so i won't try out your first suggestion what i actually intend to do is to have some code on amazon web services that can be used to change code on another domain i assumed that 'another domain' would need to have 'something' on it that said that my script was allowed to make changes does that make any sense? let me know what you think thanks Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832776 Share on other sites More sharing options...
allworknoplay Posted May 12, 2009 Share Posted May 12, 2009 thanks for the reply well... i want to do it the proper way... so i won't try out your first suggestion what i actually intend to do is to have some code on amazon web services that can be used to change code on another domain i assumed that 'another domain' would need to have 'something' on it that said that my script was allowed to make changes does that make any sense? let me know what you think thanks Right, the code on ABC.com would take care of all the tasks of creating whatever directory or file name. All you have to do is really provide it with a couple of POST or GET values from XYZ.com If you can make ABC.com check for a value to make sure that it's coming from XYZ.com then it's a lot safer... So if 123.com wants to make changes, they won't know what the $_POST['account'] value is so they won't be able to come in and make changes...your script on ABC.com would just exit... Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832781 Share on other sites More sharing options...
OM2 Posted May 12, 2009 Author Share Posted May 12, 2009 aaah... well... what i wanted was to have php code only on one domain the other domain wouldn't have any php code ok: that might sound like making life hard! i wanted to create a service that anyone could use to change files on their domain (ok... so there's also other issues like different people would have different hosting!! so it won't be possible to write universal php code - but i'll think about that after solving the first problem) let me know what u think thanks Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832789 Share on other sites More sharing options...
allworknoplay Posted May 12, 2009 Share Posted May 12, 2009 aaah... well... what i wanted was to have php code only on one domain the other domain wouldn't have any php code ok: that might sound like making life hard! i wanted to create a service that anyone could use to change files on their domain (ok... so there's also other issues like different people would have different hosting!! so it won't be possible to write universal php code - but i'll think about that after solving the first problem) let me know what u think thanks I'm not sure I understand the service then. If people want to change files on their domain, what does that have to do with you? I know I'm just not understanding what you are trying to accomplish.. Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832791 Share on other sites More sharing options...
OM2 Posted May 12, 2009 Author Share Posted May 12, 2009 thanks for the reply its just a crazy idea i've got imagine i have an editor application on my domain i want to allow others to use it to edit their files now imagine that either i don't want to give away my source code, or maybe the application is too complex to have the user host and have configured does that help explain what i'm trying to achieve? let me know thanks Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832831 Share on other sites More sharing options...
allworknoplay Posted May 12, 2009 Share Posted May 12, 2009 Ok I see what you're doing. Unfortunately this would be an absolutely insecure way to allow customers to let another domain have access to their systems...this is very dangerous IMO... The customer side would basically have a simple PHP script that allows you access to do arbitrary code, whatever it is that is typed on your edit field to send to the customer. But they still have to host some kind of PHP code.. Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832839 Share on other sites More sharing options...
OM2 Posted May 12, 2009 Author Share Posted May 12, 2009 "But they still have to host some kind of PHP code" hmmm ok... back to the drawing board i'm gonna have to think of another way to take over the world now thanks for helping me understand Quote Link to comment https://forums.phpfreaks.com/topic/157874-how-do-i-allow-one-domain-to-allow-php-from-another-domain-to-edit/#findComment-832844 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.