문제 해결을 위해 도와주세요 : D에 ID :폴더 및 데이터베이스에서 삭제 - PHP
공지 사항 : 정의되지 않은 변수 라인 \ MyWebSite \ css_pro \ 관리 \ 코어 \의 de_products_test.php 6
공지 사항 : 정의되지 않은 변수 : D에 ID : 라인 \ MyWebSite \ css_pro \ 관리 \ 코어 \의 de_products_test.php 17
코드 :
session_start();
require("../../inc/con_db.php");
$qry=mysql_query("SELECT * FROM products WHERE id='$id'");
$row=mysql_fetch_array($qry);
if($row["img_thumb"]!="") {
$thum=$row["img_thumb"];
unlink("/images/products/thumbs/".$thum);
}
if($row["img_larg"]!="") {
$larg=$row["img_larg"];
unlink("/images/products/".$larg);
}
$delete="DELETE FROM products WHERE id='$id' ";
$result=mysql_query($delete);
if($result==1) {
print "Entry delete success";
} else {
print "Entry delete failed";
}
여기서 $ id는 어디에 정의합니까? 그것은 $ id가 정의되지 않았기 때문입니다. 너는 너를 등록 전역이라고 너를 사용하고 있지 않는가? – Najzero
코드가 SQL 삽입 공격에 취약합니다. – Daedalus