Link to home
Start Free TrialLog in
Avatar of avo42
avo42

asked on

Checking file upload box

Hi All

can you please help me with this question ?

ok if i was going to check if a text feild is empty or not i would use

<input type="text" name="txt_box"  id="txt_box" />

if ($_POST['txt_box']!=""){
echo "this text box is not empty";
}

But how do i check if the file upload box is empty or not



<input name="picture" type="file" id="picture" />

if (   ******* ['picture']!=""){
echo "file upload box is not empty";
}

ive tried doing this the same way as i would check a text entry but this dont work for me

all help appriciated
Avatar of TedInAK
TedInAK
Flag of United States of America image

You access it through $_FILES - here's a quickie example: http://www.w3schools.com/php/php_file_upload.asp
Avatar of avo42
avo42

ASKER

hi thanks

thats why then

is it would be ?


if (isset($_FILES['picture'])!=""){
echo "file upload box is not empty";
}
ASKER CERTIFIED SOLUTION
Avatar of TedInAK
TedInAK
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial