I am pretty new to using the shell commands.I am doing a debugger application in php.I need to check the result of the .exe files to check whether the logic of the code is right.So I tried a test program .
The C program is
include
#define MAX 128
int main(char c)
{
const int max=127;
char array[max]; // char array[10];
char string[MAX];
scanf("%c",&c);
array[0] = string[0] = c;
printf("%c %c
", array[0], string[0]);
return 0;
}
This is compiled as se.exe
PHP CODE
<?php
define('STDIN',fopen("php://stdin","r"));
$cor1=1;
$op=shell_exec("se.exe H");
echo($op);
if($op=="H H")
$cor1+=1;
echo $cor1;
if($cor1>1)
{echo "PASSED";}
else
{echo "FAILED";}
?>
This is not echoing any values.