RE: [PHP-WIN] Problem with exec(). Help needed!
| From: | P dot Gertman at informgaz dot gazprom dot ru | Date: | Thu, 13 Mar 2003 09:52:20 +0000 |
| Subject: | RE: [PHP-WIN] Problem with exec(). Help needed! | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-18991@lists.php.net to get a copy of this message | ||
>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.