Chris <dmagick <at> gmail.com> writes: > > (Karl Pflästerer) wrote: > > Hi, > > today I wanted to use virtual (an `include' wasn't an option) to get the > > output from another PHP script. I got errors about functions being > > already defined, which is true since in both scripts are functions of > > the same name. > > I always thought virtual makes an Apache subrequest which gives me a new > > PHP environment. But similar to include the definitions from script1 are > > also in the scope of script2. > > Is this the wanted behaviour? If so, how could I insert the output from > > another PHP script (I could fetch it with curl or wget but that's the > > last thing I would like to do)?. What if I inserted with virtual > > another .html file which in turn uses mod_include to insert with > > <!--#include virtual ...--> the PHP script (sounds like loop the loop)? > > More of an apache question really. The #include virtual stuff is all > handled by apache, not php. > > Looks like SSI's support cmd and/or exec: > > http://httpd.apache.org/docs/2.2/mod/mod_include.html#element.exec > > Why is an include not an option? What are you trying to achieve? > Hi, include is not an option because the output of the script to be inserted should be included in other files as well; not all of them written in PHP. Furthermore the script outputs a <form>..</form> which if you submit it calls that script which parses and controls the user input. So it would be good, if all information concerning the input would be written in that script. So I could use that script also in html pages though mod_include or Perl pages through something similar. But that means that that script has to have all functions it needs to check user input etc. And the problem is now, that some of these functions are not in a separate lib file but are all defined in each script which needs them (that can't be changed because a lot of scripts are written in that way). So the solution seemed to be `virtual' but that doesn't work (that also means that scripts included with `virtual' could overwrite global variables; another problem). I will try the approach with an html proxy script but I'm not sure if that is really the behaviour to be expected from `virtual'. KP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php