sfcode
An Online Competing and Development Environment
Variables
compile.php File Reference

Variables

 $postData = file_get_contents("php://input")
 
 $uname = $postData['username']
 
 $filename = $postData['filename']
 
 $f_path = $postData['path']
 
 $language = $postData['language']
 
 $ret_stat = 0
 
if(strcmp($language, ".cpp")==0) else if (strcmp( $language, ".java")==0)
 

Detailed Description

This script compiles a given code file (except python code files) for a user using the compiler correponding to the language of the code file, using system() function. Returns an error if there is a compilation error.

Variable Documentation

◆ if

if
Initial value:
{
echo json_encode(fread($file, filesize($out_fname)))