[!--quoteo(post=364018:date=Apr 12 2006, 03:24 PM:name=chriscloyd)--][div class=\'quotetop\']QUOTE(chriscloyd @ Apr 12 2006, 03:24 PM) [snapback]364018[/snapback][/div][div class=\'quotemain\'][!--quotec--] okay i need help it uploads the file and enters it into the directory heres the actual part that uploads it works fine but i want to give the image a random name using numberand letters can u help me? [code]<? //other code above not shown for personal reasons $target_path = "userimages/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $filename = $_FILES['uploadedfile']['name']; $fileaddress = "userimages/".$_FILES['uploadedfile']['name']; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; mysql_query("INSERT INTO `pictures` (`pid`, `uid`, `file`, `description`, `filename`) VALUES ('', '$userid', '$fileaddress', NULL, '$filename')") or die(mysql_error()); } else{ echo "There was an error uploading the file, please try again!"; } ?>[/code] [/quote] idea: [code]substr(trim(md5("sitename".$numberofrows)), 0,8) //number of rows can be gotten using a mysql function, i'll post it's name if needed[/code]