Securing file uploading
Readability

It's a bit difficult to comment on the security aspects of code that's hard to read.
There are several readability issues here:


The indentation is very messy and inconsistent throughout.
It would be good to clean that up and use consistent indenting,
for example use 4 spaces inside every code block (inside { ... })
$_FILES["file".$x] is duplicated in many places,
which makes the code look very noisy.
You could save it in a local variable and the whole thing will look a lot simpler.
It's good to put a space around operators, for example:


instead of: $newfilename=$date." ".$originalname;
write like this: $newfilename = $date . " " . $originalname;



Simplify

Other simplifications are possible.

Instead of listing up all the lowercase and uppercase variants of extensions like this:


$allowedExts = array("docx", "DOCX", "DOC", "doc","pdf","PDF");



You could use list just in lowercase, and when you need to check the extension,
just wrap that in strtolower, like this:

in_array(strtolower($extension), $allowedExts)




You could reduce one nesting level in the conditions. Instead of this:


  if ($_FILES["file".$x]["error"] &gt; 0) {
    // ...
  } 
  else {
    if (file_exists($destinationdirectory . $_FILES["file".$x]["name"])) {
      // ...
    } else {
      // ...
    }
  }



You could use an elseif:

  if ($_FILES["file".$x]["error"] &gt; 0) {
      // ...
  } elseif (file_exists($destinationdirectory . $_FILES["file".$x]["name"])) {
      // ...
  } else {
      // ...
  }