<?php
ob_start();
echo "<html>\n<head>";
?>




<?php
$hide=0;
	if ($_POST['f'] =="2")
	{



		$db=mysql_connect ("localhost", "chieljan_root", "root") or die ('I cannot connect to the database because: ' . mysql_error());
	mysql_select_db ("chieljan_CWN");
		//replace the above two string's with your database specific values
		if (isset($binary_File) && $binary_File != "none") 
		{
 			
			
			if (get_magic_quotes_gpc()) 
			{
				$data = fread(fopen($binary_File, "rb"), filesize($binary_File));
			}else{
				$data = addslashes(fread(fopen($binary_File, "rb"), filesize($binary_File)));
			}
			
			//$data = addslashes(fread(fopen($binary_File, "rb"), filesize($binary_File)));
			
			//echo $data;
				$strDescription = $_POST['beschrijving'];
    
  			$sql = "INSERT INTO doc_documenten ";
  			$sql .= "(beschrijving, document, categorie, filename, filesize, filetype ) ";
  			$sql .= "VALUES ('$strDescription', '$data', '2',";
  			$sql .= "'$binary_File_name', '$binary_File_size', '$binary_File_type')";
    
 			$result = mysql_query($sql, $db)or die("Query failed during data-addition: " . mysql_error());
    		 
 			?>
 			
 			<meta http-equiv="Refresh" content="4;url=http://www.chieljan.com/conventie/index.php"> 	
 			
 			<?php
 			$msg = "Hartelijk dank. Het document is toegevoegd aan de website. U word nu teruggestuurd naar de Hoofdpagina." . "<br>" .
			 "<br>" . "Indien u niet word doorgestuurd, " . "<a href='index.php'>" . "klik dan hier" . "</a>" . ".";
			
 		}
		mysql_close();
		$hide="1";
	}
		else{
	$msg = "Via deze pagina kunt u een document toevoegen aan de database." ;
}
	
?>	
	
<title>ChielJan.com-CWJ</title> 

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 

<link rel="stylesheet" type="text/css"
href="mystyle.css" /> 

</head> 

<body>





<table width="100%" height="100%" valign="top">

  <tr> 

    <td width="10%" BGCOLOR="#FFFFFF" style="background-image: url(images/back.gif); background-repeat: repeat-y;"></td>

    <td width="80%" valign="top"> <div id="ipbwrapper"> 

        
 
<!--IBF.BANNER-->
<div id='logostrip'>
  <a href='http://www.chieljan.com/forums/index.php?s=3de74d7ee70e5326b0829f61bb290a43&amp;' title='Board Home'><img src='images/logo4.gif' alt='Powered by Invision Power Board' border="0" /></a>
</div>
<!-- IE6/Win TABLE FIX -->
<!--
<table  width="100%" cellspacing="6" id="submenu">
<tr>
            <?php 
            //print "normally the weblinks go here ";
            ?>
</tr>
</table>
-->
<br>
<table width="100%" id="userlinks" cellspacing="6">
   <tr>
            <td>
            <div id="usermenu">
            <a href='admin.php'>Admin home</a>&nbsp;
            <a href='adddoc.php'>Document toevoegen</a> 
             &nbsp;</td>
            </div>
            <td align='right'>&nbsp; <?php echo $userlinks ?> </td>
          
   </tr>
   
  </table>
<div id='navstrip' align='left'></div>
      </div>
  
           	
</div>	
<br>
<?php
print $msg;

if ($hide!="1")
{
	
?>
<br><br><br>
<form name="input" action="upload.php" method="post" ENCTYPE="multipart/form-data">>
		<input type="hidden" name="f" value="2">
		Beschrijving:<br>
		<input type="text" name="beschrijving" size="60"><br><br>
		Categorie:<br>
		<select name="cars">
		<option value="Test">test</select><br><br>
		Document:<br>
		<input type="file" NAME="binary_File">
		<br><br>
		<input type="submit" value="Opslaan">
</form>
<?php
}
?>
	
<tr>

 <td colspan="8" class='darkrow2' align='center' valign='middle'>

  <center>

          Skin by <a href="http://www.communatrix.com">gisteren</a> for <a href="http://www.ibunique.com">ibunique.com</a> 

          &copy; 2003 All Rights Reserved.

        </center><!-- Copyright Information -->

<div align='center' class='copyright'>Powered by <a href="http://www.invisionboard.com" target='_blank'>Invision Power Board</a>(U) v1.3 Final &copy; 2003 &nbsp;<a href='http://www.invisionpower.com' target='_blank'>IPS, Inc.</a></div>

 </td>

</tr>

















        

      

    <td width="10%" BGCOLOR="#FFFFFF" style="background-image: url(images/back2.gif); background-repeat: repeat-y;"></td>

  











</table></body> 

</html>
        

      

    <td width="10%" BGCOLOR="#FFFFFF" style="background-image: url(images/back2.gif); background-repeat: repeat-y;"></td>

  











</table></body> 

