Jump to content

problem with avatar uploading


Ristiisa

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.