אשכול: אבטחת האתר.
View Single Post
ישן 15-11-10, 15:24   # 3
Haimz
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Sep 2010
הודעות: 1,221

Haimz לא מחובר  

אני מאבטח באמצעות הפונק הבאה (לפי מה שהבנתי, GET ו POST, אבל בPOST אני לא שם mysql_real_escape_String בכל מקרה תראה של GET )

PHP קוד:
function protectGET($string) {
  
$way "get"// write POST or GET to protect
  
if($way == "post") {
    
$rem $_POST[$string];
  } else {
    
$rem $_GET[$string];
  }
  
$enc strip_tags(mysql_real_escape_string(htmlspecialchars(trim($rem)));
  return 
$enc;

  Reply With Quote