RE: [PHP] How Do I Return Values Across Servers
If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: ?php $answer = 'no'; ? If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] How Do I Return Values Across Servers This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do I Return Values Across Servers
Yes, I want to get a value from a script on Server A that runs against a database on Server A, returning that value to a script variable on Server B. I read the manual but must have missed something. This is what *seemed* as if it should work: Server A (containing functions and database) qotd.php ?php requireonce('miscfuncs.php'); $qotd= qotd(); ? ** qotd()is a f(x) in miscfuncs.php = Server B test.php ... HTML stuff ?php include 'http://www.servera.com/qotd.php'; echo $qotd . \nbr\n; ? ... More HTML stuff With this setup I get the following error: Warning: Failed opening 'http://www.servera.com/qotd.php' for inclusion (include_path='.;c:\php4\pear') in c:\webdev\kids\homebody.inc on line 27 Any ideas? I know that I am missing something here. Thanks, Bill -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:45 PM To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] Subject: RE: [PHP] How Do I Return Values Across Servers If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: ?php $answer = 'no'; ? If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] How Do I Return Values Across Servers This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill -- 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] How Do I Return Values Across Servers
Issue you have is that if it is on another server you must you a http etc transport to get it!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 9:38 AM To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED] Subject: RE: [PHP] How Do I Return Values Across Servers Yes, I want to get a value from a script on Server A that runs against a database on Server A, returning that value to a script variable on Server B. I read the manual but must have missed something. This is what *seemed* as if it should work: Server A (containing functions and database) qotd.php ?php requireonce('miscfuncs.php'); $qotd= qotd(); ? ** qotd()is a f(x) in miscfuncs.php = Server B test.php ... HTML stuff ?php include 'http://www.servera.com/qotd.php'; echo $qotd . \nbr\n; ? ... More HTML stuff With this setup I get the following error: Warning: Failed opening 'http://www.servera.com/qotd.php' for inclusion (include_path='.;c:\php4\pear') in c:\webdev\kids\homebody.inc on line 27 Any ideas? I know that I am missing something here. Thanks, Bill -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:45 PM To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] Subject: RE: [PHP] How Do I Return Values Across Servers If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: ?php $answer = 'no'; ? If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] How Do I Return Values Across Servers This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill -- 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