ok, so I made this and this works just fine and well:
$file_name = $HTTP_POST_FILES['ufile1']['name'];
$file_name_for_db = ($HTTP_POST_FILES['ufile1']['name']);
$new_file_name = $id."_pic1_".$file_name;
$path = "../users/".$username_session."/photos/".$new_file_name;
if($ufile !=none)
{
copy($HTTP_POST_FILES['ufile1']['tmp_name'], $path);
$path_of_pic = "../users/".$username_session."/photos/".$id."_pic1_".$file_name_for_db;
mysql_query("UPDATE pictures SET pic_1 = '".$path_of_pic."' WHERE id = '$id'");
header("location:../upload/");
}
else
{
echo "Error";
}
Now what I've been trying to do is add restrictions.
I've looked through many restriction tutorials, they don't work, always returns error no matter what.
I just want to restric from users uploading anything other than pictures (.png, .jpg, .jpeg, .gif, .bmp) and no more than 5mb
I can do this in HTML, but you can easily get past that. I'm pretty new to programming, so I apologize if the way I write my codes is poor and bulky.
This site has helped me a whole bunch a few times! You guys are awesome! thanks in advance.