Jump to content

How do I allow one domain to allow PHP from another domain to edit?


OM2

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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...

 

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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..

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.