PHP Problem

Associate
Joined
13 Jan 2007
Posts
2,424
Location
Belfast,Northern Ireland
Basically im trying to make it possible to upload a new section with or without an image. On line 52 you will see the !file line, yet anytime I try to upload without a file selected, I am hitting the error on line 89. I do not understand why, surely it shouldnt even be getting that far down and when no file is present should be entering the SQL loop?

http://pastebin.com/j2LemcJq
 
File is always set if you are declaring the var to begin with isnt it?

$file = $_FILES['file']['tmp_name'];
 
yup, tried it before i saw your post mate and got it working. Still don't quite understand it as I use it the way it has been done there to check if a file has been added or not on other pages and it works as it should :(

All resolved now though
 
Back
Top Bottom