Viewing File: /people/testlab/www/testlab.com.pl/panel/upload_skrypt.php

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?

include('../config.php');
if (!islogin()) die();
include('../inc/db.php');
$db = new DBConnect();

echo "<script>parent.document.getElementById('file_loader').innerHTML='<img src=img/loader.gif>';</script>";


$max_rozmiar = 200*1024*1024;
$foto=md5(date("Ymdhis"));
 
if (is_uploaded_file($_FILES['plik']['tmp_name']))
{
  if ($_FILES['plik']['size'] > $max_rozmiar) 
  {
   die ("<script>parent.document.getElementById('fImage').reset();alert('Plik za duży!')</script>");					
  }
  else
  {
     
    $res = move_uploaded_file($_FILES['plik']['tmp_name'],'../script/s'.$_POST['page_id'].'.php');
    $sql= "update `pages` set skrypt='1' where id='".$_POST['page_id']."';";
    
	$result = $db ->query($sql);
    
	if ($result != 0)
	{
	echo "<script>parent.document.getElementById('file_loader').innerHTML='';
	parent.location.reload();
	</script>";
	}
	/*
	else echo "<script>
	parent.document.getElementById('file_loader').innerHTML='Wystąpił błąd zapisu do bazy danych!';
		</script>";
	*/
				
  }
}
else
echo "<script>parent.document.getElementById('file_loader').innerHTML='Błąd podczas przesyłania pliku!';</script>";



?>
Back to Directory File Manager