File Upload Validation Query
Using DB to create an upload function.
I've created an image width (max pixel value 940) validation, however, if it is found to exceed this value during upload, the file continues to save to the server - it doesn't fail and prevent save.
<
if (isset($_POST["nhSendUpload"]) || isset($_POST["nhSendUpload_x"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_nhAddPhoto1_202_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_POST["nhImageLoadSize"]))?$_POST["nhImageLoadSize"]:"") . "",1,50000,"",",.",true,2);
$WAFV_Errors .= WAValidateNM(((isset($_POST["nhImageLoadWidth"]))?$_POST["nhImageLoadWidth"]:"") . "",1,940,"",",.",true,1);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"nhAddPhoto1_202");
}
}
>
Any ideas why this is so?