FILTER_VALIDATE_INT, 'thename' =>FILTER_SANITIZE_STRING, 'theuid' => FILTER_VALIDATE_INT, 'thecment' => FILTER_SANITIZE_STRING ); $sanitizeinputs = filter_input_array(INPUT_POST, $args); //$sanitizeinputs = filter_input_array(INPUT_POST, $args); $em=""; $comment_review=""; $thepost=$_POST["thecment"]; $theimgid=$_POST["thepid"]; $theuser=$_POST["thename"]; $theuserid=$_POST["theuid"]; $thepost=strip_tags($thepost,"
"); $thepost=filter_words($thepost); $sql=sprintf("INSERT INTO `hc_comment` (`hc_comment`.`hc_imgid`,`hc_comment`.`hc_uid`,`hc_comment`.`hc_uname`,`hc_comment`.`hc_comment`) VALUES (%s, %s, %s,%s)", GetSQLValueString($theimgid, "int"), GetSQLValueString($theuserid, "int"), GetSQLValueString($_POST["thename"], "text"), GetSQLValueString($thepost, "text")); $query=$database->database_query($sql) or $em=$em.$database->database_error(); $hcid=$database->database_insert_id(); if($em=="") { $thenow=date('m/d/Y h:m:s'); $sqlcu="SELECT `se_users`.`user_photo`, `se_users`.`user_blocklist`, `se_users`.`user_invisible` FROM `se_users` WHERE `se_users`.`user_id` = ".$theuserid." LIMIT 1"; $querycu=$database->database_query($sqlcu) or $em .= $database->database_error(); $row = $database->database_fetch_row($querycu); $uimg=$row[0]; $ubl=$row[1]; $uinv=$row[2]; if($uimg != "") { $uipi = pathinfo($uimg); $uiname=$uipi['filename']; $uiext=$uipi['extension']; $udir = (((int)($theuserid/1000))*1000)+1000; $theudir=$_SERVER["DOCUMENT_ROOT"]."/uploads_user/".$udir."/".$theuserid."/"; $uthumb=$theudir.$uiname."_thumb.".$uiext; if(file_exists($uthumb)) { $uphoto="/uploads_user/".$udir."/".$theuserid."/".$uiname."_thumb.".$uiext; } else { $ufull=$theudir.$uiname.".".$uiext; if(file_exists($ufull)) { $uphoto="/uploads_user/".$udir."/".$theuserid."/".$uiname.".".$uiext; } else { $uphoto="/images/nophoto.png"; } } // } else { $uphoto="/images/nophoto.png"; } $comment_review .='
'.$thenow.'
'.stripslashes($thepost).'
'; } //$hc_cid=$database->database_insert_id(); $arr = array ('error'=>$em,'cment'=>$sql,'rcment'=> $comment_review); echo json_encode($arr); ?>