2010년 3월 10일 수요일

post, get, cookie, session 변수 확인

[code php]$DebuggingMethod = 1; function GetMethodType($CheckingMethod, $TranceMethod) { echo "-----------------------------------------------------------------\n"; echo "" . $TranceMethod . "\n"; echo "-----------------------------------------------------------------\n"; $first_counter = 1; foreach ($CheckingMethod as $first_key => $first_value) { if ( is_array($first_value) ) { $second_counter = 1; foreach ($first_value as $second_key => $second_value) { echo " - " . $second_counter . ". " . $second_key . " = " . $second_value . "\n"; $second_counter++; } } else { echo "" . $first_counter . ". " . $first_key . " = " . $first_value . "\n"; $first_counter++; } } echo "-----------------------------------------------------------------\n"; } if ( $DebuggingMethod ) { if ( $_POST ) { GetMethodType($_POST, "POST"); } if ( $_GET ) { GetMethodType($_GET, "GET"); } if ( $_COOKIE ) { GetMethodType($_COOKIE, "COOKIE"); } if ( $_SESSION ) { GetMethodType($_SESSION, "SESSION"); } }[/code]

댓글 없음:

댓글 쓰기