[EMAIL PROTECTED] writes:
> Dear Brian, Marco et al:
> Sorry to be persistent, but I am pretty sure that
> my postings have been misunderstood, and the last
> reply I just got from Marco confirms it.
> 
> I'm hoping once you understand the question, the
> "bogus" nature of the question will go away.
> 
> According to the php "include()" manual, and
> in my own experience, it is perfectly valid to
> request that a remote file be executed as php, 
> using include() or require().  One need only
> compile using "URL fopen wrappers": (manual quotes in [[[ ]]])

Maybe I'm just dense, but if this is what you need to have happen
(execute the code on the remote server and pass back the data), then
why not use fopen() or file() instead of include(), and echo a
serialization of your retrieved data? For instance, something like:

--main.php--
<?php /* -*- mode: c++; minor-mode: font -*- */ 
error_reporting(E_ALL);
$fp = fopen('http://shanna.outlander.ca/~torben/phptest/includechild.php', 'r');
$retval = fread($fp, 200000);
fclose($fp);
$returned_data = wddx_deserialize($retval);
print_r($returned_data);
?>


--includechild.php--
<?php /* -*- mode: c++; minor-mode: font -*- */
mysql_connect('localhost', 'user', 'pass');
mysql_select_db('somedb');
$result = mysql_query('select * from sometable');
$return_data = array();
while ($return_data[] = mysql_fetch_array($result, MYSQL_ASSOC)) {}
echo wddx_serialize_value($return_data);
?>


Now, I'd not like to speculate on what you might want to do to that to
decrease the security risks, but the general idea works. Could use
some error checking, too. ;)

Is this something like what you wanted?


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 +1.604.709.0506


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to