Wat is hier fout aan?
Codeblok (load.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function uploadImage($img_ff, $dst_path, $dst_img){
//Get variables for the function.
//complete path of the destination image.
$dst_cpl = $dst_path . basename($dst_img);
//name without extension of the destination image.
$dst_name = preg_replace(/.[^.]*$/, , $dst_img);
//extension of the destination image without a "." (dot).
$dst_ext = strtolower(end(explode(".", $dst_img)));
//Check if destination image already exists, if so, the image will get an extra number added.
while(file_exists($dst_cpl) == true){
$i = $i+1;
$dst_img = $dst_name . $i . . . $dst_ext;
$dst_cpl = $dst_path . basename($dst_img);
}
//upload the file and move it to the specified folder.
move_uploaded_file($_FILES[$img_ff][tmp_name], $dst_cpl);
//get type of image.
$dst_type = exif_imagetype($dst_cpl);
//Checking extension and imagetype of the destination image and delete if it is wrong.
if(( (($dst_ext =="jpg") && ($dst_type =="2")) || (($dst_ext =="jpeg") && ($dst_type =="2")) || (($dst_ext =="gif") && ($dst_type =="1")) || (($dst_ext =="png") && ($dst_type =="3") )) == false){
unlink($dst_cpl);
die(
}
}
?>
Quote:
Notice: Undefined index: proof in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/pages/load.php on line 73
Notice: Undefined variable: i in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 14
Notice: Undefined index: proof in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 20
Warning: exif_imagetype(./images/1.): failed to open stream: No such file or directory in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 23
Warning: unlink(./images/1.): No such file or directory in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 27
The file "1." with the extension "" and the imagetype "" is not a valid image. Please upload an image with the extension JPG, JPEG, PNG or GIF and has a valid image filetype.
http://prntscr.com/4y34c5
Codeblok (load.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function uploadImage($img_ff, $dst_path, $dst_img){
//Get variables for the function.
//complete path of the destination image.
$dst_cpl = $dst_path . basename($dst_img);
//name without extension of the destination image.
$dst_name = preg_replace(/.[^.]*$/, , $dst_img);
//extension of the destination image without a "." (dot).
$dst_ext = strtolower(end(explode(".", $dst_img)));
//Check if destination image already exists, if so, the image will get an extra number added.
while(file_exists($dst_cpl) == true){
$i = $i+1;
$dst_img = $dst_name . $i . . . $dst_ext;
$dst_cpl = $dst_path . basename($dst_img);
}
//upload the file and move it to the specified folder.
move_uploaded_file($_FILES[$img_ff][tmp_name], $dst_cpl);
//get type of image.
$dst_type = exif_imagetype($dst_cpl);
//Checking extension and imagetype of the destination image and delete if it is wrong.
if(( (($dst_ext =="jpg") && ($dst_type =="2")) || (($dst_ext =="jpeg") && ($dst_type =="2")) || (($dst_ext =="gif") && ($dst_type =="1")) || (($dst_ext =="png") && ($dst_type =="3") )) == false){
unlink($dst_cpl);
die(
The file "
. $dst_img . " with the extension " . $dst_ext . " and the imagetype " . $dst_type . " is not a valid image. Please upload an image with the extension JPG, JPEG, PNG or GIF and has a valid image filetype.);}
}
?>
Quote:
Notice: Undefined index: proof in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/pages/load.php on line 73
Notice: Undefined variable: i in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 14
Notice: Undefined index: proof in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 20
Warning: exif_imagetype(./images/1.): failed to open stream: No such file or directory in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 23
Warning: unlink(./images/1.): No such file or directory in /home/jespar/domains/jespar.s3.one2xs.com/public_html/vtc/includes/image.php on line 27
The file "1." with the extension "" and the imagetype "" is not a valid image. Please upload an image with the extension JPG, JPEG, PNG or GIF and has a valid image filetype.
http://prntscr.com/4y34c5

