Forum Moderators: coopster
I have 2 choices on the form, upload a photo or a checkbox for no photo.
I want to to do a check so if they checked no photo as well as picked a file to upload, it reports back that they need to fix it.
how do you check to see if userfile exists?
here is what i define in the script.
$userfile = $_FILES['userfile']['name'];
of to be more secure change your IF to
if(!empty(trim($_FILES['userfile']['name'] )) ) {
this will remove spaces then will check if there is any value coming in this field ........
to go to the next level ,, use regex to determine the expected path and extension of the file
dont i feel like a dork.
I was trying that code before i posted with no luck, i go back using what you replied with to see what i was doing wrong.
I was defining my sql statement when I wasn't running it so it looked like nothing was happening. (I was using the code somewhere else before using it for what i said in my post)