2015-02-04 2 views
1

나는 코드를 올바르게 작성했다고 생각하지 않습니다. 누군가 이것을 볼 수 있습니까? 나는 PHP에 처음이다! 여기에 몇 가지 예제에서 ISSET stackoverflow 코드의 오류

<?php 
// Create Connection 
$connect = mysqli_connect('localhost','root','test123','joomla'); 

// Check Connection 
if(mysqli_connect_errno($connect)) { 
    echo 'Failed to connect to DataBase| '. mysqli_connect_error(); 
} 
?> 

나는 rp_id은 url 매개 변수에 존재하지 않는 경우에 if(issets($_GET['rp_id'])) 추가 - 그것은 단지 당신이()는 isset에 오타가 같은

<?php 
if(issets($_GET['rp_id]')) { 
    $rp_id = htmlspecialchars($_GET["rp_id"]); 
    // open record with evdet_id =$rp_id 
    $result = mysqli_query($connect,"SELECT * FROM n0dap_jevents_vevdetail WHERE evdet_id =".$rp_id); 

    while($row = mysqli_fetch_array($result)): 
     $value = $row['google_map']; 
     echo $value; 
     endwhile; 
    } 

    $connect->close(); 
    //if the rp_id does exist the go ahead and run the top otherwise close it. 
} else { 
    $connect->close(); 
} 
?> 
+0

[SQL 주입 공격] (http://bobby-tables.com)에 취약합니다. htmlspecialchars는 ** 이에 대한 방어책이 아닙니다 **. –

답변

1
if(issets($_GET['rp_id])) 

이 보이는 데이터베이스를 닫습니다. 정의되지 않은 함수 issets에

()를 호출

이것은 당신이 그렇지 않은 함수로 issets()를 호출하려고하는 것을 의미한다. 찾고있는 함수는 isset()입니다. issets()를 isset()으로 대체하면 더 이상 오류 메시지가 표시되지 않습니다.

관련 문제