fork download
  1. <?php
  2. // test.php
  3.  
  4. echo "<form action='test.php' method='get'>";
  5. echo "試著輸入一個參數<input type='text' value='3' name='N' />";
  6. echo "<br><input type='submit' />";
  7. echo "</form>";
  8.  
  9. if(isset($_GET['N']))
  10. {
  11. $N = $_GET['N'];
  12.  
  13. // execute R script from shell
  14. // this will save a plot at temp.png to the filesystem
  15. exec("Rscript my_rscript.R $N");
  16.  
  17. // return image tag
  18. $nocache = rand();
  19. echo("<img src='temp.png?$nocache' />");
  20. }
  21. ?>
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
 ^
Main.java:1: error: class, interface, or enum expected
<?php
  ^
Main.java:5: error: class, interface, or enum expected
echo "????????<input type='text' value='3' name='N' />";
^
Main.java:6: error: class, interface, or enum expected
echo "<br><input type='submit' />";
^
Main.java:7: error: class, interface, or enum expected
echo "</form>";
^
Main.java:9: error: class, interface, or enum expected
if(isset($_GET['N']))
^
Main.java:15: error: class, interface, or enum expected
  exec("Rscript my_rscript.R $N");
  ^
Main.java:18: error: class, interface, or enum expected
  $nocache = rand();
  ^
Main.java:19: error: class, interface, or enum expected
  echo("<img src='temp.png?$nocache' />");
  ^
Main.java:20: error: class, interface, or enum expected
}
^
11 errors
stdout
Standard output is empty