을 방지하기 위해 mysqli_real_escape_string()을 사용해야합니다
if(isset($_GET['input']) or isset($_GET['input2']) or isset($_GET['input3']))
{
$release=$_GET['input'].$_GET['input2'].$_GET['input3'];
echo $release;
}
을하지만 때문에 ' AND 대신에 OR을 다시 테스트하면 OR 조건 중 하나에 해당하는 OR 테스트가 필요하며, 나머지 두 가지가 설정되지 않은 경우에도 알림/오류가 표시됩니다.
당신은
if (isset($_GET['input']) && isset($_GET['input2']) && isset($_GET['input3'])) {
//...
}
처럼 뭔가를 할 것, 세 가지의 존재를 확인하려면이 아마 당신은 지저분한 테스트없이 달성하기 위해 노력하고 무엇을하지 :
// count will return however many key=>val pairs are in the array,
// 0 will fail
if (count($_GET)) {
// an empty array and an empty string to hold iterated results
$get = array();
$release = '';
// iterate through $_GET and append each key=>val pair to the local array,
// then concat onto the string
foreach($_GET as $key=>$val) {
$get[$key] = $val;
$release .= $get[$key];
}
echo $release;
}
HTH :)
을
편집 : 표시된 다른 항목과 같이 배열 키가 모두 설정되어 있는지 테스트해야하는 경우 0을 건너 뜁니다.
이
// extract imports all of the array keys into the symbol table.
// It returns the number of symbls imported, and automatically
// sets vars using keys for var name:
if (extract($_GET) && isset($input,$input2,$input3)) {
echo $release = $input.$input2.$input3;
}
(.는 isset에 전달 여러 인수를 사용하여)
이 조건부가 확인해야하는 것은 무엇입니까? – MarcinJuraszek
입력이 설정되어 있는지 확인한 다음 변수에 입력하고 에코 아웃합니다. 일반적으로 모든 입력 값은 /가 기본값입니다. –