mardi 24 mars 2015

IF statement in php Retains answer from previous run

I Have the following code.



$Case_Answer = 99.999;

$Compile = exec('javac Main.java');

if ((exec('java Main')) == $Case_Answer){
echo "Correct";}
else
echo "Incorrect";


My problem results when I run the script several times.


If I run this php script with all correct values and making sure that Main.java compiles. Everything works well.


When I run it a second time after modifying Main.java so it does not compile correctly. The if statement will execute whatever it did the previous run. I need it to refresh every time and it cause a problem. Does anyone know how to resolve this?


All help would be appreciated.


Aucun commentaire:

Enregistrer un commentaire