You say it isnt working but you didnt say what it did exactly?
Does it say the file is too big? or does it act like everything is ok but still doest work?
There are a couple of things I would change, but I dont know if they are causing a problem since you didnt realy specify what was happening.
I never use arrays inside a string e.g. "$user_info[member_id].jpg" I always anchor them to the string like so:
$user_info[member_id].".jpg"
Seems to work a lot more reliably that way.
I have changed your code accordingly:
if ($submit) {
if ($_FILES['userfile']['type'] == "image/jpeg") {
if ($_FILES['userfile']['size'] <= 300000) {
$user_info = mysql_fetch_array(mysql_db_query($db_name, "SELECT member_id FROM $tbl_member WHERE login='$login'"));
$tmpfile = $_FILES['userfile']['tmp_name'];
$file = $user_info[member_id].".jpg";
move_uploaded_file($tmpfile,"$rootpath/uploads/$file");
showmessage('Sådär, du kan folk se hur du ser ut också (förhoppningsvis)');
} else { showmessage('Filen du laddar upp får inte vara större än 300Kb.'); }
} else { showmessage('Filen du laddar upp måste vara en jpeg fil.'); }
}