Web Hacking

PHP backticks shell command (``)

gooja 2009. 7. 27. 10:48
PHP 에서 exec() 함수와 같은 기능을하는 backtiks 이 있다.
``Note that these are not single-quotes!
backtick(``) 를 이용해서 shell 명령어를 실행할 할 수 있다.

<예>
<?php
$output 
= `ls -al
`;
echo 
"<pre>$output</pre>"
;
?>

<pre></pre>는 실행결과를 자동으로 줄바꿈을 해서 보기 편리하다.