<?php 
$docid = $_GET['docid'];
ob_start();
session_start();

if( !isset($_SESSION['user']) ) {
 header("Location: ../index.php");
 exit;
}


header('location: ../files/documents/'.$docid.'')

?>
<script>
window.print();
</script>