Ik doe waarschijnlijk iets verkeerd, weet alleen niet wat
Errors:
Code (php)
1
2
3
2
3
Warning: move_uploaded_file(/emblems/upload/upload/397_image.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\web\apache\htdocs\tg\includes\p_functions.php on line 439
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php1554.tmp' to '/emblems/upload/upload/397_image.jpg' in C:\web\apache\htdocs\tg\includes\p_functions.php on line 439
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php1554.tmp' to '/emblems/upload/upload/397_image.jpg' in C:\web\apache\htdocs\tg\includes\p_functions.php on line 439
De code:
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($_POST['emblemupload']))
{
if ($_FILES['uploaded']['size'] > '15000')
{
$_SESSION['MSG'] = 'The image must be less than 15kb in size.';
}
elseif($_FILES['uploaded']['type'] == "image/gif") {
$ok=1;
}
elseif($_FILES['uploaded']['type'] == "image/jpeg") {
$ok=1;
}
elseif($_FILES['uploaded']['type'] == "image/png") {
$ok=1;
}
else
{
$_SESSION['MSG'] = '<p>Only gif, jpg, and png formats are allowed.</p>';
}
$target = "/emblems/upload/upload/";
$target = $target . basename( $_FILES['uploaded']['name']);
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
$target = 'upload/' . basename( $_FILES['uploaded']['name']);
mssql_query("UPDATE Clan SET EmblemChecksum = EmblemChecksum + 1 WHERE Name = '".$_SESSION['CClan']."'");
mssql_query("UPDATE Clan SET EmblemUrl = 'upload/".$target."' WHERE Name = '".$_SESSION['CClan']."'");
$_SESSION['MSG'] = '<p>Your emblem has been uploaded. Please allow some time for your emblem to appear.</p>';
}
else
{
$_SESSION['MSG'] = '<p>There was an unexpected error.</p>';
}
}
?>
if(isset($_POST['emblemupload']))
{
if ($_FILES['uploaded']['size'] > '15000')
{
$_SESSION['MSG'] = 'The image must be less than 15kb in size.';
}
elseif($_FILES['uploaded']['type'] == "image/gif") {
$ok=1;
}
elseif($_FILES['uploaded']['type'] == "image/jpeg") {
$ok=1;
}
elseif($_FILES['uploaded']['type'] == "image/png") {
$ok=1;
}
else
{
$_SESSION['MSG'] = '<p>Only gif, jpg, and png formats are allowed.</p>';
}
$target = "/emblems/upload/upload/";
$target = $target . basename( $_FILES['uploaded']['name']);
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
$target = 'upload/' . basename( $_FILES['uploaded']['name']);
mssql_query("UPDATE Clan SET EmblemChecksum = EmblemChecksum + 1 WHERE Name = '".$_SESSION['CClan']."'");
mssql_query("UPDATE Clan SET EmblemUrl = 'upload/".$target."' WHERE Name = '".$_SESSION['CClan']."'");
$_SESSION['MSG'] = '<p>Your emblem has been uploaded. Please allow some time for your emblem to appear.</p>';
}
else
{
$_SESSION['MSG'] = '<p>There was an unexpected error.</p>';
}
}
?>
Specifieke lijn:
Weet iemand misschien wat ik fout doe?
Gewijzigd op 01/01/1970 01:00:00 door Stefan
wijst naar
$target = "/emblems/upload/upload/";
$target = $target . basename( $_FILES['uploaded']['name']);
en /emblems/upload/upload/ bestaat niet
deze bestaat wel.
Haal de / voor emblems eens weg.
Dankje, het werkt