Current Path : /home/da040400/www_root/adm/
Upload File :
Current File : /home/da040400/www_root/adm/pridaj_foto.php

<?php
	require_once('auth.php');
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>ADMIN - Výlety</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf8">
<META name="description" content="Ekovýlety">
<META name="keywords" content="Ekovýlety, exkurzie, podujatia pre školy a verejnosť">
<META name="author" content="vladimir bacik" >
<META name="copyright" content="http://www.sodbtn.sk">
<meta name="Robots" content="index,follow">
<meta name="Revisit-after" content="5">  
<LINK href="styly.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/demo.css">

<body>


<br>
<center>
<table width="950" class="admin">
<tr><td class="hlava_adm" height="60">Administrácia stránky - EKOVYLETY.sk</td></tr>
<tr><td class="menu_adm" height="25">
<a class="admin" href="index.php">úvodná stránka</a>
</td></tr>
<tr><td class="hlavna">
<br>

<center>

<?php
	include('identifikacia.php');
?>
</center>

<center>

<?php 

#$target = "images/";
$target = "../upload/";
#$target = "upload/"; 
$target = $target . basename( $_FILES['foto']['name']); 

$id_vylet=$_POST['id_vylet'];
$pic=($_FILES['foto']['name']);

require("spojenie.php"); # Vložíme skript, ktorý obsahuje nastavenie pripojenia.
$spoj = MySQL_Connect($SQL_Server, $SQL_Uzivatel, $SQL_Heslo) OR DIE(MySQL_Error());
MySQL_Select_Db($Databaza) OR DIE(MySQL_Error());
mysql_query("set names utf8");

//Writes the information to the database 
#MySQL_Query("INSERT INTO cms VALUES (NULL, '$podujatie', '$terminkonania', '$komentar', '$pic', NOW())") OR DIE(MySQL_Error());
#mysql_query("INSERT INTO `cms` VALUES (NULL, '$name', '$email', '$phone', '$pic', NOW())") ;
#mysql_query("INSERT INTO `produkty2` VALUES (NULL, '$nazov', '$znacka', '$kategoria', '$predajna', '$popis', '$stara_cena', '$nova_cena', '$pic', '1', NOW())") ; 

mysql_query("INSERT INTO `andy_fotky` VALUES (NULL, '$id_vylet', '$pic')") ;

//Writes the photo to the server 
if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) 
{ 

//Tells you if its all ok 



echo "<center><br><br><span class='uspech'>Fotka bola úspešne nahraná</span><br><br>";
echo "<a class='mail' href='index.php'>späť na úvodnú stránku</a></center>";


#echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; 
} 
else { 

//Gives and error if its not 

echo "<center><br><br><span class='uspech'>Fotka bola úspešne nahraná</span><br><br>";
echo "<a class='mail' href='index.php'>späť na úvodnú stránku</a></center>";


#echo "Sorry, there was a problem uploading your file."; 
} 
?>

<br><br>
</center>

<?php
MySQL_Close($spoj);
?> 



</td></tr></table>
</center>


</body>
</html>

DR.KR LITE SHELL COPYRIGHT 2016