M
M
Maxim2018-11-30 23:42:27
PHP
Maxim, 2018-11-30 23:42:27

How to integrate code execution on the site?

Hello.
How can you integrate code execution on your site? There is, for example, repl.it , where you can run code online in different languages. How can this be implemented or is there a ready-made technology?
The challenge is interactive learning.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexyz Canson, 2018-12-01
@jone21

an example of code execution in php, the situation is similar with other languages

$message=shell_exec('php -r "'.$_POST['inputMemo'].'"');
  print_r($message);

also for other languages, it will be possible to save to a file and then reproduce and display the response on the screen
, the shell_exec command performs the role of bash

S
Stalker_RED, 2018-11-30
@Stalker_RED

Sandbox, aka sandbox.
For some technologies, they are ready-made, for others, you will have to assemble them yourself from virtual machines and a file.
So google: php sandbox , for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question