Stale pise ze nejde uploadnut do zlozku ktoru mam vytvorenu mam vytvorenu. potrebujem uploadnut obrazok ako avatara do profilu ak mate nekdo nieco lepsie funkcne pomoze
+ zobrazenie - to som zatial extra neriesil
Kód:
<form enctype="multipart/form-data" action="upload.php" method="POST">
prosim vyber subor: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
Kód:
<?php
$target = "avatar/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if ($uploaded_size > 350000)
{
echo "tvoj subor je prilis velky.<br>";
$ok=0;
}
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}
if ($ok==0)
{
Echo "tvoj subor nebol najdeny";
}
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "prepac nastal problem pri uploadovani.";
}
}
?>