Re: [PHP-DB] Include function across servers

2007-04-03 Thread Micah Stevens
No. That would be to access the code. Include grabs an entire file. 
Perhaps you should look into Ajax techniques.


-Micah

On 04/02/2007 04:06 PM, ioannes wrote:
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and 
that result gets back to that server.  So you can use include() to 
access the result of a function on another server, sounds like.




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



[PHP-DB] Include function across servers

2007-04-02 Thread ioannes
I ask this as I do not have two web sites on different servers to test 
at  the moment. 

Does it work to use an include function in the php code on one site that 
calls a function on the other site?  If you include a file on a remote 
server that runs a function, where does the function run - on the server 
where the function is originally written or on the calling server?  I am 
thinking that if I write code, it is one way to make the functionality 
available without actually disposing of the source code itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database would 
need to be fully referenced: user, password, server, and the calling 
(shared) host for instance will ask for the remote IP address to add to 
a white list.)


John

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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Micah Stevens

I'm not totally clear on what you're asking, so here's two options:

If you use the include() function, you're pulling the code from the 
external server and running on the local server. If you're running an 
HTTP call, say via an Ajax routine for example, the code runs on the 
external server.


The difference is if you're grabbing the source from the external server 
and running it on the local php interpreter, or if you're using the 
external php setup.


This seems to be what you're asking, the answer in this case is, either 
one could happen, it depends on your implementation. If you provide 
details on the exact implementation then I can give a more exact answer.


HTH,
-Micah

On 04/02/2007 06:53 AM, ioannes wrote:
I ask this as I do not have two web sites on different servers to test 
at  the moment.
Does it work to use an include function in the php code on one site 
that calls a function on the other site?  If you include a file on a 
remote server that runs a function, where does the function run - on 
the server where the function is originally written or on the calling 
server?  I am thinking that if I write code, it is one way to make the 
functionality available without actually disposing of the source code 
itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database 
would need to be fully referenced: user, password, server, and the 
calling (shared) host for instance will ask for the remote IP address 
to add to a white list.)


John



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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Tony Miceli
wouldn't that be very dangerous if someone could grab my code and run it on 
their server?


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


thanks
tony


 
My email address has changed. It is now [EMAIL PROTECTED] Visit my website
- Original Message - 
From: Micah Stevens [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Monday, April 02, 2007 4:20 PM
Subject: Re: [PHP-DB] Include function across servers



I'm not totally clear on what you're asking, so here's two options:

If you use the include() function, you're pulling the code from the 
external server and running on the local server. If you're running an HTTP 
call, say via an Ajax routine for example, the code runs on the external 
server.


The difference is if you're grabbing the source from the external server 
and running it on the local php interpreter, or if you're using the 
external php setup.


This seems to be what you're asking, the answer in this case is, either 
one could happen, it depends on your implementation. If you provide 
details on the exact implementation then I can give a more exact answer.


HTH,
-Micah

On 04/02/2007 06:53 AM, ioannes wrote:
I ask this as I do not have two web sites on different servers to test at 
the moment.
Does it work to use an include function in the php code on one site that 
calls a function on the other site?  If you include a file on a remote 
server that runs a function, where does the function run - on the server 
where the function is originally written or on the calling server?  I am 
thinking that if I write code, it is one way to make the functionality 
available without actually disposing of the source code itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database would 
need to be fully referenced: user, password, server, and the calling 
(shared) host for instance will ask for the remote IP address to add to a 
white list.)


John



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



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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Chris

Tony Miceli wrote:
wouldn't that be very dangerous if someone could grab my code and run it 
on their server?


Yeh, pretty dangerous. That's how c99shell and a bunch of other scripts 
work.


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


If they are named with an extension that isn't parsed by php (eg .txt), 
then they will be executed on another server.


If they are parsed by php (ie .php) then including them remotely won't 
work - it will include whatever your php script spits out (eg html).


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


Right.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Tony Miceli
thanks for your reply. that's what i figured using common sense, but that's 
not always the case with software.


cu
tony
 
My email address has changed. It is now [EMAIL PROTECTED] Visit my website
- Original Message - 
From: Chris [EMAIL PROTECTED]

To: Tony Miceli [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Monday, April 02, 2007 6:24 PM
Subject: Re: [PHP-DB] Include function across servers



Tony Miceli wrote:
wouldn't that be very dangerous if someone could grab my code and run it 
on their server?


Yeh, pretty dangerous. That's how c99shell and a bunch of other scripts 
work.


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


If they are named with an extension that isn't parsed by php (eg .txt), 
then they will be executed on another server.


If they are parsed by php (ie .php) then including them remotely won't 
work - it will include whatever your php script spits out (eg html).


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


Right.

--
Postgresql  php tutorials
http://www.designmagick.com/ 


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread ioannes
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and that 
result gets back to that server.  So you can use include() to access the 
result of a function on another server, sounds like.


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Bastien Koert

use cURL to execute the remote code

Bastien



From: ioannes [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Include function across servers
Date: Tue, 03 Apr 2007 00:06:25 +0100

I have a particular business application so just returning html is OK, the 
output is the useful bit in this case.  I understand from the discussion 
that I can still run my code on my server in response to a remote server 
requesting the result of a function in that file and that result gets back 
to that server.  So you can use include() to access the result of a 
function on another server, sounds like.


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



_
RealLiveMoms: Share your experience with Real Live Moms just like you 
http://www.reallivemoms.ca/


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Chris

ioannes wrote:
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and that 
result gets back to that server.  So you can use include() to access the 
result of a function on another server, sounds like.


You can include code, but you can't run a function from another server.

That code could include a function but that doesn't mean you'll get the 
right results from it.


For example:

?php

mysql_connect();

function get_categories()
{
  $return = array();
  $query = select * from categories;
  $result = mysql_query($query) or die(problem:  . mysql_error());
  while ($row = mysql_fetch_assoc($result)) {
$return[] = $row;
  }
  return $return;
}

?


including that from a remote server will query your local database - it 
will not query your remote database.


So I really suggest finding another way to do whatever you are trying to 
do...


1) for security reasons (you don't want anyone else to be able to access 
your database or anything else because if you can do it, so can I - plus 
a lot of other things to get into your server)


2) for practicality reasons (eg the above)

3) for usability reasons (eg the remote server crashes, your 
website/whatever is inaccessible because functionality can't be retrieved)


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] include function

2004-04-07 Thread Craig Hoffman
Ok, I figured it out.  I am using jpgraph and I need to place the 
include statement next to the start of PHP.

?
included statement
__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
On Apr 6, 2004, at 10:24 PM, Craig Hoffman wrote:
Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include (include/dbadmin.php);
include (jpgraph/src/jpgraph.php);   
include (jpgraph/src/jpgraph_bar.php);
Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] include function

2004-04-06 Thread Craig Hoffman
Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include (include/dbadmin.php);
include (jpgraph/src/jpgraph.php);   
include (jpgraph/src/jpgraph_bar.php);
Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] include function

2004-04-06 Thread Marcjon Louwersheimer
did you make sure the previous line had a ; at the end? Check that first.


- Original message -
From: Craig Hoffman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Tue, 6 Apr 2004 22:24:27 -0500
Subject: [PHP-DB] include function

Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include (include/dbadmin.php);
include (jpgraph/src/jpgraph.php);   
include (jpgraph/src/jpgraph_bar.php);

Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media

v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
  Marcjon

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