RE: [PHP] How Do I Return Values Across Servers

From: Date: Wed, 08 Jan 2003 23:37:49 +0000
Subject: RE: [PHP] How Do I Return Values Across Servers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130822@lists.php.net to get a copy of this message
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 . "\n<br>\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:phplists@hitcho.com.au] Sent: Wednesday, January 08, 2003 4:45 PM To: 'Bill Arbuckle, Jr.'; php-general@lists.php.net 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: tim@hitcho.com.au > -----Original Message----- > From: Bill Arbuckle, Jr. [mailto:bill@wingshooter.net] > Sent: Thursday, 9 January 2003 8:17 AM > To: php-general@lists.php.net > 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

« previous php.general (#130822) next »