execute a remote file before including it.

This is a discussion on execute a remote file before including it. within the PHP Language forums, part of the PHP Programming Forums category; I'm trying to modify a banner display function so it can be including on remote websites. If I just ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-09-2003
Nick Messick
 
Posts: n/a
Default execute a remote file before including it.

I'm trying to modify a banner display function so it can be including
on remote websites. If I just include the file from a remote website
the code isn't executed before it is put into the page. I would like
my code (which picks a random banner) to execute on the remote site so
when I include it a random banner show up.
Reply With Quote
  #2 (permalink)  
Old 09-09-2003
Erwin Moller
 
Posts: n/a
Default Re: execute a remote file before including it.

Nick Messick wrote:

> I'm trying to modify a banner display function so it can be including
> on remote websites. If I just include the file from a remote website
> the code isn't executed before it is put into the page. I would like
> my code (which picks a random banner) to execute on the remote site so
> when I include it a random banner show up.


???

You cannot of course.

How would you feel when I started executing MY PHP-code on your server?
If you want some code executed on another machine, contact its owner...

Regards,
Erwin

Reply With Quote
  #3 (permalink)  
Old 09-09-2003
bugs
 
Posts: n/a
Default Re: execute a remote file before including it.

Organization: College of Computing, Georgia Tech

Erwin Moller <> wrote:
> Nick Messick wrote:


>> I'm trying to modify a banner display function so it can be including
>> on remote websites. If I just include the file from a remote website
>> the code isn't executed before it is put into the page. I would like
>> my code (which picks a random banner) to execute on the remote site so
>> when I include it a random banner show up.


> ???


> You cannot of course.


> How would you feel when I started executing MY PHP-code on your server?
> If you want some code executed on another machine, contact its owner...


lets the owner of the other machine does not have a problem with me running
a script on his server and then displaying the output on my server..

how would I do it then??
Reply With Quote
  #4 (permalink)  
Old 09-09-2003
Tom Thackrey
 
Posts: n/a
Default Re: execute a remote file before including it.


On 9-Sep-2003, Erwin Moller
<since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:

> Nick Messick wrote:
>
> > I'm trying to modify a banner display function so it can be including
> > on remote websites. If I just include the file from a remote website
> > the code isn't executed before it is put into the page. I would like
> > my code (which picks a random banner) to execute on the remote site so
> > when I include it a random banner show up.

>
> ???
>
> You cannot of course.
>
> How would you feel when I started executing MY PHP-code on your server?
> If you want some code executed on another machine, contact its owner...


What you can do is execute the php on your server to modify the banner and
return it as an image.

The remote server would pass HTML to the client like
<img src="http://yourserver.com/banner.php">
The client browser would make the request to your server where the php code
would return the appropriate headers and the image data.


--
Tom Thackrey
www.creative-light.com
Reply With Quote
  #5 (permalink)  
Old 09-09-2003
Geoff Berrow
 
Posts: n/a
Default Re: execute a remote file before including it.

Message-ID: <ggm7b.630$T37.443@newssvr29.news.prodigy.com> from Tom
Thackrey contained the following:

>The remote server would pass HTML to the client like
><img src="http://yourserver.com/banner.php">
>The client browser would make the request to your server where the php code
>would return the appropriate headers and the image data.


Is there any way of doing this so that it returns code instead of an image?
(to create an embedded guest book or something)

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #6 (permalink)  
Old 09-10-2003
Matt
 
Posts: n/a
Default Re: execute a remote file before including it.

You can sort of do what you're after...

<script language="javascript" type="text/javascript"
src="http://yourserver/script.php"></script>

This tag is put on the remote website. script.php should do whatever
work you want it to do, then send HTML output wrapped in
document.write() functions. I.E. script.php would return something
like:

document.write('Look at this!<br>');
document.write('<img src="http://someserver/someimage.jpg">');

And that code would be run by the user's browser in place where you
had the <script> tag on the page on the remote website. Can give you
an example if you need one. :)
Reply With Quote
  #7 (permalink)  
Old 09-10-2003
Randell D.
 
Posts: n/a
Default Re: execute a remote file before including it.


"Nick Messick" <nospam@trendwhore.com> wrote in message
news:24c499fd.0309082353.76b9c8f7@posting.google.c om...
> I'm trying to modify a banner display function so it can be including
> on remote websites. If I just include the file from a remote website
> the code isn't executed before it is put into the page. I would like
> my code (which picks a random banner) to execute on the remote site so
> when I include it a random banner show up.


I've read the history - you could do two things... one, have your chap who
has the PHP server create the banner in to a 'javascript' type file - That
way, from the remote server, you only have to include, and execute the
javascript

Alternativly, you could use an html <iframe> tag and just call the page from
their server thus giving you full forms access without changing the address
bar (which I gather is one of your issues).


Reply With Quote
  #8 (permalink)  
Old 09-10-2003
bugs
 
Posts: n/a
Default Re: execute a remote file before including it.

Matt <google@mralston.com> wrote:
> document.write() functions. I.E. script.php would return something
> like:


> document.write('Look at this!<br>');
> document.write('<img src="http://someserver/someimage.jpg">');


what If I want to return a php function, which the user can use on his page.
Basically, I want to give only certain users access to this one function.
So I want to authenticate them before they run that function, the only
problem being that authentication needs to be done on the main machine and
not where the user is using the function. Thus, I want the users to include
this one file, which is running on the main server, and if they authenticate
right, I return the function. Also, this authentication needs to be automatic
i.e. on a script to script level, not a human to html page level.

any idea how??

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0