0){ echo ''; } else { echo ''; } ?>
Account Management MenuMain MenuLogout
"; $allowedExts = array("gif", "jpeg", "jpg", "png", "bmp"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/bmp")) && ($_FILES["file"]["size"] < 65536) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB
"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
"; if (file_exists("/tmp/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { // move_uploaded_file($_FILES["file"]["tmp_name"],"/tmp/" . $_FILES["file"]["name"]); // echo "Stored in: " . "/tmp/" . $_FILES["file"]["name"]; $results = insert_avatar($_FILES["file"]["tmp_name"],$_SESSION['username']); echo $results . "
"; } } } else { echo "Invalid file, please check file and retry.
"; echo "Possible problems could be file type or size.
"; } ?>