Help eith php

Hi all, i need some help with my php code. I want to create upload form with 4 fields : two dropdown buttons, 1 text field and the browse button. I have problem with validating my files ,because i want only to upload pptx, ppt and pdf files , to check the file name , because it can be written in cyrillic and a don't want this. Also if there is the same file in the DB to change the name ( it' can be done with-- $random_digit=rand(0000,9999); $new_file_name=$random_digit.$file_name;-- or something like that) Can anyone help me, my code till now is :

So you want somebody to give you the form code to go with this??
And you want to check filename for cyrillic characters?
And you want to rename a file if it already exists?
And you want some DB functionality?