mysql "LIKE" or EXACT against filter string
We have and upload functions on our webpage, and there we have a filter
database that you can add things that the user must not be allowed to
upload.
And the upload side we have a mysql query that was suppose to block upload
if the name persist in the filter database.
Our query now is :
$DB->query("SELECT id FROM filter WHERE filter LIKE '%".
$Properties['Title'] ."%'");
if($DB->record_count() != 0) {
$Err = '[b]Cannot upload this![/b]';
include(SERVER_ROOT . '/sections/upload/upload.php');
die();
}
Problem now is if we block : My.Dog.In.The.Ocean.My.HomeVid.mp4 Then it
also blocks: My.Dog.In.The.Garden.Avi
We need the query only to block if the filter string exist in the name
EXCATLY.
Any ideers on what to change so that it blocks correctly?
*Note: $DB->record_count = function to cover mysqli_num_rows
Ofcause, we got $Properties to be the properties of uploaded element, and
thereby Title to to be the string title
No comments:
Post a Comment