Forum Moderators: coopster

Message Too Old, No Replies

simple web service call by pasting an include URL

how to do that?

         

macdar

3:32 pm on Jan 23, 2007 (gmt 0)

10+ Year Member



Hi there,

I'm running a community site, with chats, user profiles etc..

I'd like to give other webmasters ability to use my app on their sites. I'd like to do that as SIMPLE as possible - prefferably by pasting a single url:

[partner.mydomain.com...]

the problem is I don't want to rewrite exiting code: I want to call the code Ive written so far, and runs on my site.

also, I found auto_prepend and auto_append directives which in conjuction with the global vars such as $SERVER_NAME and $SERVER_ADDR, could make this work even better.

anyone has any experience with it? I just made some quick research and that's all I got at the moment. Any input appreciated.

thanks.

macdar

1:08 pm on Jan 24, 2007 (gmt 0)

10+ Year Member



any thoughts?

jatar_k

3:08 pm on Jan 24, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I've used includes for tracking scripts on client sites, works fine

hard to say what needs to be done, not really sure where you are having issues or whether the script has output, etc

cmarshall

4:11 pm on Jan 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use include("http://..."); all the time.

Your PHP installation needs to have allow-url-fopen [us2.php.net] enabled, which it is by default. Some tinfoil-enabled admins may turn it off.

You should check your PHP version (<? php_info();?>). I think that it wasn't well supported before 4.3.

macdar

1:15 pm on Jan 25, 2007 (gmt 0)

10+ Year Member



here's the deal:

as I said, I have a website already running, that consists of whole bunch of script:

chat.php, register.php, profile.php, etc, etc..

and I access it by typing www.mydomain.com/chat.php

but I'd liek to create a service for other gigs so that they take advantage of my app, by pasting a simple URL, like:

include("http://partner.mydomain.com/index.php?s=SESSIONID&p=PARTNERID....etc..");

ok, so whats the big deal? they have already included my app, right?
the problem is, the chat has embedded links (ie people's nickname are linked to their profiles). so when someone clicks on the link, it would actually lead to my site.
But I don't want that. I'd like people to think they are still on the same site. I need just to retrieve content from my site.

as I said before, I don't wanna rewrite my existing code, instead I want to prepare environment before any code is executed. that's where auto_prepend and auto_append come into play. and that's where I got stuck;) I mean I tried with fopen, but that's not the way to go (broken links etc..)

I think I would have to get affiliate's URL from query,
go get content (ie chat), and redirect it back at the affiliate address with the content embedded to it. Is this possible to do that?

cmarshall

2:16 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll PM you something to look at.

macdar

2:38 pm on Jan 25, 2007 (gmt 0)

10+ Year Member



thanks cmarshall,

but that's what's going on client side. I need to figure out how to process stuff on server side.

many thanks though.

cmarshall

3:13 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use relative URIs for everything, and I have a token that is supplied to the server in order to tell it not to render a page (instead, it renders only the content data in a <table>). CSS is supplied by the client, not the server.

That client-side stuff is important, though. If the client doesn't do that, good luck. We tried a bunch of scenarios before settling on that.

You could wrap the client side stuff in an SDK, and send that to people who want to embed your service.