[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: any chance to se PHP incorporated in wml?



On Thu, 1 Apr 1999, Jim Hebert wrote:

>Well, how you implement this largely depends on which pass you'd like php3
>to be. We'll assume that somewhere in the neighborhood of 3 is good, since
>you mention ePerl.

       just after 3rd pass, maybe pass 3a or instead of perl in 3rd
       pass. 

>I have no idea how the php3 interpreter is used/invoked/whatever, but
>let's assume I can just feed it code on the stdin and get results on the
>stdout. *shrug*

       it works just like the perl interpreter.

><perl>
>open PHP, "|/usr/local/bin/php > /home/me/tmp/php-tmp$$"; # watch for races!
>print PHP <<END_OF_PHP;
>php3 code goes here
>END_OF_PHP
>close PHP;
>open PHP, "</home/me/tmp/php-tmp$$";
>print <PHP>;
>close PHP;
></perl>

       actually, this works! but with one big limitation: i have to
       escape every special character, since php uses the same way of
       variable naming, $variable, as perl.

       that means this:
<perl>
open PHP, "|/usr/local/bin/php > /home/me/tmp/php-tmp$$"; # watch for races!
print PHP <<END_OF_PHP;

something out of PHP

<?php

echo "This line doesn't contain any variables, and it will be
interpreted correctly, even if it's spred over two lines";

$this_variable = "will cause a parse error in PHP, since perl will interpret";
$another_line = "the dollar signs and PHP will get just  this_variable";

\$but_this_variable = "will be interpreted correctly even in PHP";
\$line_2 = "because perl will deliver the dollar sign";

?>

Out of PHP, again


END_OF_PHP
close PHP;
open PHP, "</home/me/tmp/php-tmp$$";
print <PHP>;
close PHP;
</perl>

       so.... can i somehow tell to the perl 'dont interpret
       anything, just deliver it to the PHP, it will do the rest'?

-- 
      v
Davor Cengija
Davor.Cengija@fsb.hr
-------------------------------------------------
Doktore, malo sam neodlučan... a možda i nisam...

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com