Commit de2633b0 authored by Gudipaty Aniket's avatar Gudipaty Aniket

Added compile.php

parent c1502b82
<?php
$postData = file_get_contents("php://input");
$uid = $postData['id'];
$filename = $postData['filename'];
$language = $postData['language'];
$ret_stat = 0;
if(strcmp($language, "cpp") == 0)
{
$base = basename($filename, ".cpp");
system("g++ " . $uid . "/" . $filename . " -o " . $uid . "/" . $base , $ret_stat);
if($ret_stat != 0)
{
unlink($uid . "/" . $base);
}
}
else if(strcmp($language, "java") == 0)
{
$base = basename($filename, ".java");
system("javac " . $uid . "/" . $filename , $ret_stat);
if($ret_stat != 0)
{
unlink($uid . "/" . $base . ".class");
}
}
echo $ret_stat;
?>
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment