RE: [PHP] a code question..??

2005-11-11 Thread bruce
would the approach be to use an iframe, and some sort of ajax code, to allow
the user to interact with the dialog/code within the iframe. keep in mind,
that the code within the iframe would be running on the remote server...

-bruce


-Original Message-
From: comex [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 7:57 PM
To: php-general@lists.php.net
Subject: Re: [PHP] a code question..??


 the app B server would then return a result, based on the user input...
i'm
 trying to figure out how to essentially allocate a section of the page, to
a
 remote application. after i've finished with the remote stuff, the user
 could go ahead and select other items/buttons on the page that are in the
 current environment

You could just use an iframe...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-11 Thread comex
 would the approach be to use an iframe, and some sort of ajax code, to allow
 the user to interact with the dialog/code within the iframe. keep in mind,
 that the code within the iframe would be running on the remote server...

Sorry, I had forgotten the content of the original question.  If what
you want is a login dialog, then it would probably be easiest to make
your own login form, then use CURL (or HttpClient
(http://scripts.incutio.com/httpclient/index.php), which doesn't
require anything external) like the other posters suggested when the
form is submitted, to pretend to be a person filling out app B's login
dialog.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-11 Thread Richard Lynch
On Thu, November 10, 2005 6:02 pm, bruce wrote:
 in your example, wouldn't app A, essentially download the code from
 app B,
 and run the source on app A? or would the code be run on app B, with
 the
 resulting html/content/page being transferred to app A?

Yes, but I've NEVER in this entire thread understood which server you
wanted to run the code in the first place...

If you want B to run the code, then just web-scrape the results.

If you want A to run the code, then have B deliver code to A to run.

You can do whichever one you want.

 would this be better if it were perhaps done as a soap client/server
 process... of course, the fact that the user's php would have to have
 the
 soap extensions installed would be an issue...

Which goes back to our earlier statement, that you've abstracted this
out so well, and left out so many details, that none of us really
understand what you're trying to do in the first place.

Which doesn't really matter:
Whichever one you want to do, you can do it.

If you want to add the overhead of SOAP and require B to have SOAP to
play with you, that's fine.  If not, that's fine too.

I've been thinking about buying a new car.  Which car should I buy?

This is the level at which you're asking us to help you, so it should
be no surprise our answer seems like it's just Yes.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-11 Thread Richard Lynch
On Thu, November 10, 2005 7:41 pm, bruce wrote:
 +---+
 |   |
 |   user|
 |  'sub_btn'|
 |   |
 |   |
 |   |
 |   |
 |  blah |
 |  blah |
 |  blah |
 |   |
 |   |
 |   |
 +---+

 in this example, the user/sub_btn is generated from the app B
 server/system.

Presumably blah, blah, blah is on A, right?...

 the user would then fill in the 'user' and hit the 'sub_btn', causing
 the
 information to be sent back to the app B server.

 the app B server would then return a result, based on the user
 input... i'm
 trying to figure out how to essentially allocate a section of the
 page, to a
 remote application. after i've finished with the remote stuff, the
 user
 could go ahead and select other items/buttons on the page that are in
 the
 current environment

 i'm not sure what's the best approach to this...

How much do you trust the remote applications?

How much power do you need to give them for them to be able to
generate the correct output for their space allocated to them?

How much data needs to transfer for them to know what content to
generate?

How much content will the be generating?

How flexible will this need to be for A and B content decisions?

What sort of volume of traffic are you looking at?

Until we know more, our answer remains:
Yes, you can do this any number of ways, depending on what you want
to do

You can web-scrape, you can SOAP, you can RPC, you can require source
code back and forth, you can get the elves to do all the work for you.

We don't know which way you want to go with this either, because we
don't know any of the parameters that affect the decisions, much less
know what you're actually trying to do.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread Richard Lynch
On Thu, November 10, 2005 2:20 pm, bruce wrote:
 i have a situation where i have a client app (A), and another app (B).
 i'd
 like to be able to have app A have a login dialog. I'd like the login
 dialog
 to be comming/run from app B. so i envision somehow having code from
 app B
 within app A, that essentially is bing run

If this all lives on the same server, some include files and some
flags or some function arguments to do anything different between A
and B could do this.

If they live on different servers, you could use http://php.net/curl
to manage the I/O back and forth, probably.

Or, you could use include() with url_file_wrappers (?) turned on and
have app B output the PHP source for app A to run.

There are probably several more options.

It's difficult to provide quality answers, because you've abstracted
things very nicely, to the point that our advice could easily lead you
to do something inherently risky.

User authentication being shared between A and B was beaten to death
in another thread recently.

-- 
Like Music?
http://l-i-e.com/artists.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread bruce
the primary issue i'm trying to address is whether it's possible for a php
app to somehow display on one app, code/forms that essentially resides on
another server? doens't have to be a login form..

in all honesty, i don't see how it can be possible..

using curl, would simply download the code from app B to app A which isn't
what i want. i'm looking to keep the code on app B from being
modified/played with, which is why i'm inclined to think the code/form in
question needs to be able to be run from app B...

-bruce




-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 1:01 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] a code question..??


On Thu, November 10, 2005 2:20 pm, bruce wrote:
 i have a situation where i have a client app (A), and another app (B).
 i'd
 like to be able to have app A have a login dialog. I'd like the login
 dialog
 to be comming/run from app B. so i envision somehow having code from
 app B
 within app A, that essentially is bing run

If this all lives on the same server, some include files and some
flags or some function arguments to do anything different between A
and B could do this.

If they live on different servers, you could use http://php.net/curl
to manage the I/O back and forth, probably.

Or, you could use include() with url_file_wrappers (?) turned on and
have app B output the PHP source for app A to run.

There are probably several more options.

It's difficult to provide quality answers, because you've abstracted
things very nicely, to the point that our advice could easily lead you
to do something inherently risky.

User authentication being shared between A and B was beaten to death
in another thread recently.

--
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread Ben

bruce said the following on 11/10/2005 01:15 PM:

the primary issue i'm trying to address is whether it's possible for a php
app to somehow display on one app, code/forms that essentially resides on
another server? doens't have to be a login form..

in all honesty, i don't see how it can be possible..

using curl, would simply download the code from app B to app A which isn't
what i want. i'm looking to keep the code on app B from being
modified/played with, which is why i'm inclined to think the code/form in
question needs to be able to be run from app B...


I quick stroll through the archives ought to answer your question.  You 
have many options.  It could be as simple as:


if($login) {
print(iframe src=\http://url.for.app.b\;/iframe\n);
  }

It depends what you want to do and how aware you want your two 
applications to be of each other, which you haven't really explained.


- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread bruce
here's the basic logic flow that i'm contemplating...

   app A (server A)app B (server B)
   -app displays page
   -app gets code from app B ---code/form section
   -app displays rest of
page with code/form from
app B

   -user enters name
   -app sends name to app B---  app B returns new
code/form
   -app displays new page, with
new code/form from app B
   -user enters new information
in code/form

as you can see, there are interactions that occur betwwen app A and app B.
but i'm not sure if what i'm thinking of can be accomplished...

the information in the code/forms from app B will change based on the
username...

thoughts/comments..

-bruce


-Original Message-
From: Ben [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 1:24 PM
To: php-general@lists.php.net
Subject: Re: [PHP] a code question..??


bruce said the following on 11/10/2005 01:15 PM:
 the primary issue i'm trying to address is whether it's possible for a php
 app to somehow display on one app, code/forms that essentially resides on
 another server? doens't have to be a login form..

 in all honesty, i don't see how it can be possible..

 using curl, would simply download the code from app B to app A which isn't
 what i want. i'm looking to keep the code on app B from being
 modified/played with, which is why i'm inclined to think the code/form in
 question needs to be able to be run from app B...

I quick stroll through the archives ought to answer your question.  You
have many options.  It could be as simple as:

if($login) {
print(iframe src=\http://url.for.app.b\;/iframe\n);
   }

It depends what you want to do and how aware you want your two
applications to be of each other, which you haven't really explained.

- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread Ben

bruce said the following on 11/10/2005 01:44 PM:


as you can see, there are interactions that occur betwwen app A and app B.
but i'm not sure if what i'm thinking of can be accomplished...

the information in the code/forms from app B will change based on the
username...

thoughts/comments..


As Richard suggested, curl ought to work or what ever web services 
flavour you prefer.


- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread Richard Lynch
On Thu, November 10, 2005 3:15 pm, bruce wrote:
 the primary issue i'm trying to address is whether it's possible for a
 php
 app to somehow display on one app, code/forms that essentially resides
 on
 another server? doens't have to be a login form..

 in all honesty, i don't see how it can be possible..

 using curl, would simply download the code from app B to app A which
 isn't

curl would download the HTML, not the PHP source.

You can use:
?php include http://example.com/application/B/source.phpsource;;?

to snag the source code from B and execute it on A.

That's the closest thing to what I think you may be asking... which
I'm not even sure what it is.

The 's' at the end of my URL is not a typo.  It assumes that you have
a file named source.phpsource of MIME type text/plain that dumps out
PHP code from Application B.  Application A can include and execute
this source code.

This is not a Good Idea (tm) at all if you don't implicitly trust
Application B source code to be completely free of (intentional and
unintentional) malicious/dangerous/buggy code.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread bruce
as i understand curl functions (and correct me if i'm wrong). the functions
simply allow the user/app to download/copy the file from the remote server,
where the existing app could do whatever with the content...

this isn't what i want.. i'm trying to figure out if there's a way to run a
chunk of code on a remote server... i'd rather not put the source on the
intial client-app A machine...

-bruce


-Original Message-
From: Ben [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 1:59 PM
To: php-general@lists.php.net
Subject: Re: [PHP] a code question..??


bruce said the following on 11/10/2005 01:44 PM:

 as you can see, there are interactions that occur betwwen app A and app B.
 but i'm not sure if what i'm thinking of can be accomplished...

 the information in the code/forms from app B will change based on the
 username...

 thoughts/comments..

As Richard suggested, curl ought to work or what ever web services
flavour you prefer.

- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread Ben

bruce said the following on 11/10/2005 02:30 PM:

as i understand curl functions (and correct me if i'm wrong). the functions
simply allow the user/app to download/copy the file from the remote server,
where the existing app could do whatever with the content...


It depends...  You could get the php source (which is what Richard was 
suggesting when he pointed out that the s wasn't a typo) or you could 
simply get the output of a php script (ie html or whatever it outputs) 
by requesting a php page from the remote server.  Any time you request a 
php file you are 'running it on a remote server'.  Request the file with 
curl and voila, you're done.


- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread Richard Lynch
On Thu, November 10, 2005 4:30 pm, bruce wrote:
 as i understand curl functions (and correct me if i'm wrong). the
 functions
 simply allow the user/app to download/copy the file from the remote
 server,
 where the existing app could do whatever with the content...

 this isn't what i want.. i'm trying to figure out if there's a way to
 run a
 chunk of code on a remote server... i'd rather not put the source on
 the
 intial client-app A machine...

The trick, then, is for app B to make its SOURCE CODE available for
curl on server A to snatch.

http://b.example.com/source_code.php?filename=login.php
?php
  //really BAD INSECURE code for illustration:
  $filename = $_GET['filename'];
  header(Content-type: text/plain);
  readfile($filename);
?



On server A:
?php
  include http://b.example.com/source_code.php?filename=login.php;;
?

Or you could use curl to get the code and eval it, or you could use
file_get_contents and eval it, or you could get the code, save it to a
temp file, and then include the temp file, or you could...

It's not that it can't be done.  It's that there are so many ways to
do it, we don't know where to start.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread bruce
richard...

in your example, wouldn't app A, essentially download the code from app B,
and run the source on app A? or would the code be run on app B, with the
resulting html/content/page being transferred to app A?

would this be better if it were perhaps done as a soap client/server
process... of course, the fact that the user's php would have to have the
soap extensions installed would be an issue...

-bruce


-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 3:02 PM
To: [EMAIL PROTECTED]
Cc: 'Ben'; php-general@lists.php.net
Subject: RE: [PHP] a code question..??


On Thu, November 10, 2005 4:30 pm, bruce wrote:
 as i understand curl functions (and correct me if i'm wrong). the
 functions
 simply allow the user/app to download/copy the file from the remote
 server,
 where the existing app could do whatever with the content...

 this isn't what i want.. i'm trying to figure out if there's a way to
 run a
 chunk of code on a remote server... i'd rather not put the source on
 the
 intial client-app A machine...

The trick, then, is for app B to make its SOURCE CODE available for
curl on server A to snatch.

http://b.example.com/source_code.php?filename=login.php
?php
  //really BAD INSECURE code for illustration:
  $filename = $_GET['filename'];
  header(Content-type: text/plain);
  readfile($filename);
?



On server A:
?php
  include http://b.example.com/source_code.php?filename=login.php;;
?

Or you could use curl to get the code and eval it, or you could use
file_get_contents and eval it, or you could get the code, save it to a
temp file, and then include the temp file, or you could...

It's not that it can't be done.  It's that there are so many ways to
do it, we don't know where to start.

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread comex
 in your example, wouldn't app A, essentially download the code from app B,
 and run the source on app A? or would the code be run on app B, with the
 resulting html/content/page being transferred to app A?

If the PHP file has a .php extension, it will be run on the webserver
like any PHP page.  If it is .txt or you set Apache directives, etc.,
it will be transferred to the client app.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a code question..??

2005-11-10 Thread bruce
ok...


so can i do something like...


+---+
|   |
|   user|
|  'sub_btn'|
|   |
|   |
|   |
|   |
|  blah |
|  blah |
|  blah |
|   |
|   |
|   |
+---+

in this example, the user/sub_btn is generated from the app B server/system.
the user would then fill in the 'user' and hit the 'sub_btn', causing the
information to be sent back to the app B server.

the app B server would then return a result, based on the user input... i'm
trying to figure out how to essentially allocate a section of the page, to a
remote application. after i've finished with the remote stuff, the user
could go ahead and select other items/buttons on the page that are in the
current environment


+---+
|   |
| +-+   |
| |   remote|   |
| | app |   |
| |area |   |
| +-+   |
|   |
|   |
|   local app space |
|   |
|  blah |
|  blah |
|  blah |
|   |
|   |
|   |
+---+

i'm not sure what's the best approach to this...

thanks

bruce


-Original Message-
From: comex [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 10, 2005 5:28 PM
To: php-general@lists.php.net
Subject: Re: [PHP] a code question..??


 in your example, wouldn't app A, essentially download the code from app B,
 and run the source on app A? or would the code be run on app B, with the
 resulting html/content/page being transferred to app A?

If the PHP file has a .php extension, it will be run on the webserver
like any PHP page.  If it is .txt or you set Apache directives, etc.,
it will be transferred to the client app.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a code question..??

2005-11-10 Thread comex
 the app B server would then return a result, based on the user input... i'm
 trying to figure out how to essentially allocate a section of the page, to a
 remote application. after i've finished with the remote stuff, the user
 could go ahead and select other items/buttons on the page that are in the
 current environment

You could just use an iframe...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Documenting Code Question

2005-06-12 Thread Robert Cummings
On Sun, 2005-06-12 at 08:32, Chris Drozdowski wrote:
 I need some help regarding documenting code. Say you have a 
 function/method that takes an object as a parameter and/or returns an 
 object.
 
 When documenting, do you specify the specific class of the object when 
 listing the datatype in the docblock @param and @return specs or do you 
 simply specify object?

Specific type so that users of the function know what they can do with
the returned object from reading the doc.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Documenting Code Question

2005-06-12 Thread Richard Lynch
On Sun, June 12, 2005 5:32 am, Chris Drozdowski said:
 I need some help regarding documenting code. Say you have a
 function/method that takes an object as a parameter and/or returns an
 object.

 When documenting, do you specify the specific class of the object when
 listing the datatype in the docblock @param and @return specs or do you
 simply specify object?

object is pretty useless...

Unless it's some kind of meta-function that can deal with *ANY* PHP
Object, of course.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php