> >Can you not use ODBC to connect to the Progress database? It
> will probably
> >be simpler than an exec() call... but anyway if your Progress script is
> >returning data that PHP needs to parse then try using passthru()
> instead...
> Thanks! i'll try passthru() right now.
>
> <?php
> require_once("webdoc_cfg.php");
> $fname="D:/htdocs/p/php_test_make_res.p";
> $p_code_test='{utils.i}
> writeln("<?php").
> writeln("$zzz=42;").
> writeln("echo ~"in PROGRESS zzz=$zzz~";").
> writeln("?>").';
> if(!$fp = fopen($fname, 'w'))
> {
>       print "Cannot open file ($fname)";
>       exit;
> }
> if (!fwrite($fp,$p_code_test))
> {
>       print "Cannot write to file ($fname)";
>       exit;
> }
> fclose($fp);
> passthru($_pro.' -U ******** -P ********* -p '.$fname,$pro_code2);
> echo "zzz=$zzz";
> ?>
>
> hm... it does not work!
> output of command called with passthru() is NOT parsed by PHP.
> so i get in my browser just the same bla-bla that my PROGRESS script
> generates:
> ==========================
> <?php
> $zzz=42;
> echo "in PROGRESS zzz=$zzz";
> ?>
> zzz=
> ==========================> from browser's "view source"
> Of course i can use ODBC. But ODBC driver for PROGRESS seems to
> be a really
> odd and slow thing.

But that is what passthru() does it just returns the output into your script
as raw data i.e. it is not parsed by the interpreter. You can try setting
the output of passthru() to a variable then parse the variable contents
accordingly - eval() will be your friend in that process...Anyway, I'm not
sure the method you are using is the best way forward when compared to
ODBC - these people have successfully used PHP with Progress (via ODBC of
course) http://www.newnhams.com

Rich


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to