/ Published in: PHP
This a simple wrapper for cgi, write in php, use stdin for post, and query_string env, for get
=)
=)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
< ? // system('/Applications/Darwine/Wine.bundle/Contents/bin/wine cgi-proxy.exe'); function decode($to,$encode = false) { $arrayobject = new ArrayObject($to); $iterator = $arrayobject->getIterator(); while($iterator->valid()){ if ($encode) else } return $keywords; } 2 => array("file", "/Users/gards/KitWvbv200/componentes_vbv/error-output.txt", "a") // stderr is a file to write to ); $get = decode($_GET); $post = decode($_POST); $cwd = '/Users/gards/KitWvbv200/componentes_vbv'; // $process = proc_open('/Applications/Darwine/Wine.bundle/Contents/bin/wine cgi-proxy.exe', $descriptorspec, $pipes, $cwd, $env); // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt // fwrite($pipes[0], $post); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock //echo "command returned $return_value\n"; } ?>
URL: http://renatoelias.art.br/blog/2009/09/22/php-wrapper-cgi-usando-phpwine-para-rodar-cgi/