기타/프로그래밍 관련
PHP Shell Command 방법
WebHack
2013. 7. 3. 13:12
http://stackoverflow.com/questions/4186392/php-passing-get-in-linux-command-prompt
php-cgi -f ./lotto.php kind=1 오류 시 php-cgi가 잘 못 된거 임
(/opt/lampp/bin/php-cgi -f ./lotto.php kind=1 로 하면 됨)
wget http://localhost/dev/lotto/lotto.php?kind=1
위 2가지 방법을 추천 함
/opt/lampp/bin/php -e ./lotto.php -f=1
$kind = "0";
if(isset($_REQUEST["kind"])) //query number
$kind = $_REQUEST["kind"];
else
{
$opts = getopt('f:'); //php -e ./lotto.php -f=XXX
$kind = $opts['f'];
}
위 방법은 좀 다른 방법 임