Using popen() and pclose()
<?php
$command = "/usr/bin/dialog --inputbox 'What is your Name' 0 0 2>/tmp/php_temp";
$pr = popen($command, 'w');
$exit_code = pclose($pr);
switch($exit_code) {
case 0:
$input = implode("", file("/tmp/php_temp"));
echo "\nYou typed: $input\n";
break;
case 1:
echo "\nWhy did you cancel?\n";
break;
}
?>
Related examples in the same category