분류 php

PHP에서 exec 함수

컨텐츠 정보

  • 조회 406 (작성일 )

본문

$file = $_POST['filename'];//A file which is upload by user

$piece  = explode(".",$file);//Extract the extension part of file.
$length = sizeof($piece);
//We can use this code for another language changing only in compiler
if($piece[$length-1]==="c")
{
    exec("gcc $file -o output");
    exec("./output < arguments", $out);//Arguments which is useful in program and make $out
    for ($i=0; $i ($out);>
php