RE: [PHP] Check the contents of a file field

From: Date: Mon, 05 May 2003 22:32:25 +0000
Subject: RE: [PHP] Check the contents of a file field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146461@lists.php.net to get a copy of this message
I don't think isset() will ever return '', it returns TRUE or FALSE. Try using either isset or =='' but the way you have it does not make sense. I believe that == '' is more correct since you are coming from a POST and the variable will be set whether anything was put in the field or not. > -----Original Message----- > From: shaun [mailto:shaun@mania.plus.com] > Sent: Monday, May 05, 2003 3:29 PM > To: php-general@lists.php.net > Subject: [PHP] Check the contents of a file field > > > Hi, > > I am trying to check whether the contents of a file field is empty but the > following code doesnt work: > > if(isset($_POST[file]) == ''){ > $error = "Please select a document to add to the project"; > //etc > > could someone explain my error here please? >

« previous php.general (#146461) next »