Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!empty($_FILES['attachment']))
- {
- foreach($_FILES['attachment']['tmp_name'] as $key => $tmp_name)
- {
- $start = explode(".", $_FILES['attachment']['name'][$key]);
- $ext = end($start);
- $new_filename = time()."_".rand(000000000,999999999).".".$ext;
- $save_path = "uploads/".$new_filename;
- move_uploaded_file($_FILES['attachment']['tmp_name'][$key], $save_path);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement