i make allways these upload scripts in 1 file (upload form, and the script code together).
you should determine file type ... to avoid uploading i.e. some scripts or viruses or ...
your upload dir for pics should be chmod 666.
<?php
$the_path="uploads/"; # upload dir -> chmod 666
$my_max_file_size="2048000"; # max. file size in bytes (2048000 = 2 M😎
if ($the_file_name)
{
if ($the_file_size > $my_max_file_size)
{
$sizeexceed = ($the_file_size - $my_max_file_size) / 1024;
$sizeexceed = ceil($sizeexceed);
echo "Your file is too big.";
}
else
{
if (!@copy($the_file, $the_path . "/" . $the_file_name))
{
echo "Somehting got wrong. Try later.";
}
}
}
else
{
?>
<form method="post" enctype="multipart/form-data" action=upload.php>
<input type="text" name="nickname">
</p>
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file:
<input name="the_file" type="file">
</p>
<p>
<input type="submit" value="Gogogogo !!" name=SubmitAdd>
</p>
</form>
<?php
}
?>