hallo Strict Standards: foutje
dit is de melding:
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\uploud_image.php on line 22
waar staat: // hier moet de fout zitten is lijn 22.hoop dat iemand mij kan helpen.
Code (php)
<h3>uploud image</h3>
Code (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
32
33
34
35
36
37
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
32
33
34
35
36
37
<?php
if (isset ($_FILES['image'], $_POST['album_id'])) {
$image_name = $_FILES['image']['name'];
$image_size = $_FILES['image']['size'];
$image_temp = $_FILES['image']['tmp_name'];
$allowed_ext = array ('jpg', 'jpeg', 'png', 'gif');
$image_ext = strtolower (end(explode('.', $image_name))) ; // hier moet de fout zitten
$album_id = $_POST['album_id'];
$errors = array();
if (empty($image_name) || empty($album_id)) {
$errors[] = 'something is missing';
} else {
if (in_array($image_ext, $allowed_ext) === false) {
$errors[] = 'File type not allowed';
}
if ($image_size > 2097152) {
$errors[] = 'maximum file size is 2mb';
}
if (album_check($album_id) === false) {
$errors[] = 'couldn\'t uploud to that album';
}
}
if (!empty($errors)) {
foreach ($errors as $error) {
echo $error, '<br />';
}
} else {
// uploud the image
}
}
$albums = get_albums();
if (empty($albums)) {
echo '<p>you don\'t have any albums. <a href="create_album.php">create an album</a></p>';
} else {
?>
if (isset ($_FILES['image'], $_POST['album_id'])) {
$image_name = $_FILES['image']['name'];
$image_size = $_FILES['image']['size'];
$image_temp = $_FILES['image']['tmp_name'];
$allowed_ext = array ('jpg', 'jpeg', 'png', 'gif');
$image_ext = strtolower (end(explode('.', $image_name))) ; // hier moet de fout zitten
$album_id = $_POST['album_id'];
$errors = array();
if (empty($image_name) || empty($album_id)) {
$errors[] = 'something is missing';
} else {
if (in_array($image_ext, $allowed_ext) === false) {
$errors[] = 'File type not allowed';
}
if ($image_size > 2097152) {
$errors[] = 'maximum file size is 2mb';
}
if (album_check($album_id) === false) {
$errors[] = 'couldn\'t uploud to that album';
}
}
if (!empty($errors)) {
foreach ($errors as $error) {
echo $error, '<br />';
}
} else {
// uploud the image
}
}
$albums = get_albums();
if (empty($albums)) {
echo '<p>you don\'t have any albums. <a href="create_album.php">create an album</a></p>';
} else {
?>
<form action="" method="post" enctype="multipart/form-data">
<p>Choose a file:<br /><input type="file" name="image" /></p>
<p>
Choose an album:<br />
<select name="album_id">
Code (php)
</select>
</p>
<p><input type="submit" value="Uploud" /></p>
</form>
moet u meer weten hoor ik het graag
$image_ext = explode('.', $image_name)) ;
$image_ext = strtolower (end($image_ext)) ;
ok zal het snel gaan proberen.