Answer the question
In order to leave comments, you need to log in
Creating a remote compilation system
What technologies are used to create a subject? This refers to systems similar to those used in sports programming: a person uploads his code, specifies the language, the code is sent to the server, compiled there, and the compiler's response is returned. What can be read on this topic? What technology should be used? Are there ready-made open source solutions?
Answer the question
In order to leave comments, you need to log in
If we are talking about compilation, without running, then something like this?
<?
$commands = [
'ls' => 'ls -la',
'basic' => '/path/to/basic param1 param2',
'java' => '/path/to/java param param',
];
if (isset($_FILES['file']) && !$_FILES['file']['error'] && isset($commands[$_POST['lang']]))
{
$comm = $commands[$_POST['lang']];
$file = $_FILES['file']['tmp_name'];
echo "<pre>";
echo `$comm $file 2>&1`;
echo "</pre>";
}
?>
<form enctype="multipart/form-data" method="POST">
<select name="lang">
<?php foreach ($commands as $key => $void):?>
<option><?=$key?></option>
<?php endforeach ?>
</select><input name="file" type="file" /><input type="submit" /></form>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question