PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am looking for a way to solve a problem which I just cannot seem to figure out. I have two upload fields where users can upload two files per time but it only uploads the first one and says, "Could not copy!" for the second. My code go's like:
if ($_FILES['file1'] != "")
{
if ($_FILES['file1']['size'] < "20000")
{
copy ($_FILES['file1']['tmp_name'], $FinalImage."/".$_FILES['file1']['name']) or die ("Could not copy file. Please try again!");
}
}
if ($_FILES['file2'] != "")
{
if ($_FILES['file2']['size'] < "20000")
{
copy ($_FILES['file2']['tmp_name'], $FinalImage."/".$_FILES['file2']['name']) or die ("Could not copy file. Please try again!");
}
}