Ristiisa Posted April 25, 2010 Share Posted April 25, 2010 Hello,i have problem,i have the avatar uploading on game,but it says "Je avatar voldoet niet aan de eisen" in english its "Your avatar does not meet the requirements" heres the code <?php if(isset($_POST['bewerken'])) { if($_FILES['afbeelding']['type'] == "image/pjpeg") { if($own['avatar'] != "images/avatars/empty.jpg") { unlink($own['avatar']); } $uploadedfile = $_FILES['afbeelding']['tmp_name']; $src = imagecreatefromjpeg($uploadedfile); list($width,$height)=getimagesize($uploadedfile); $newwidth = ($width < 100) ? ($width) : (100); $newheight = ($height < 100) ? ($height) : (100); $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = 'images/avatars/' . $own['id'] . md5($_FILES['afbeelding']['tmp_name']) . '.jpg'; imagejpeg($tmp,$filename,100); imagedestroy($src); imagedestroy($tmp); mysql_query("UPDATE users SET avatar = 'images/avatars/" . $own['id'] . md5($_FILES['afbeelding']['tmp_name']) . ".jpg' WHERE id = '" . $own['id'] . "'"); echo'Je hebt het plaatje opgeslagen.<br /><br />'; missiondone(2); } else { echo'Je avatar voldoet niet aan de eisen.<br /><br />'; } } echo' Het plaatje moet een jpg extensie hebben. Hij wordt automatisch naar het formaat 100 x 100 verkleind. <form method="post" enctype="multipart/form-data"> Upload:<br /> <input type="file" name="afbeelding" class="input"><br /> <input type="submit" value="Uploaden" name="bewerken" class="submit"> </form>'; ?> please help,thanks. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 25, 2010 Share Posted April 25, 2010 Have you echoed $_FILES['afbeelding']['type'] to see what it contains so that you can find why it is not matching the "image/pjpeg" string? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.