|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-11-21 14:38 UTC] steve at petabit dot com
Related to bug 14164: All workarounds I have tried to pass variable data back from a remotely include()d or require()d script have failed. Arrays and strings don't appear to be passed back in the include()'s return value, it will only pass back integers. If anyone sees another way to do this please help! I will keep looking and post a followup here and to the manual if I find a workaround. Steve Rapaport PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 21:00:02 2025 UTC |
Hi, what are you means with remote? include("http://www.mysite.com/phpscript.php"); Dont work. the .php are parsed befor and you cant get source to your script. If you need content from a database so print's it as csv and use the output in your script. http://www.php.net/csv -- Marco Btw. Ask this type of question on the general or dev mailing list.If you use include('http://some_server/something.php'); something.php is executed on "some_server". It's impossible to return strings with "return" from there. But the output of http://some_server/something.php is included in your script and executed there. So just make _the output_ of something.php a valid php script which sets your variables - so you can use these variables in your local script. E.g.: <?php // something.php on the remote server echo '<?php $return_value = "a string"; ?>'; ?> On the local server: <?php include('http://some_server/something.php'); echo $return_value; ?> As the manual explicitly mentions that you can use a return statement to pass values from the included script, but does not mention that this doesn't work via HTTP or FTP, I'd say this is a Documentation problem. (I don't know what the manual said in 2001, maybe the return statement could not be used in included files back then.)