| 
 Posted by Guy on 07/01/39 11:51 
Ian Davies a écrit : 
> Hi 
>  
> Can anyone tell me why the following code will NOT work 
> The error message should be displayed when there is something in both fields 
>  
>  if ((isset($_POST['Link']) && $_POST['Link'] !=='') && 
> (isset($_POST['uploadedfile']) && $_POST['uploadedfile'] !=='')) { 
>  $error_msg.="<br>You can't select to upload a link and a file at the same 
> time."; 
>  
> curiously the following works 
>  
>  if(empty($_POST['Link']) || $_POST['Link'] ='' && 
Hi 
= is not operator; try == 
 
> empty($_FILES['uploadedfile']) || $_FILES['uploadedfile'] ='') { 
 
idem 
G 
 
>  $error_msg.="<br>You didn't select whether to upload a link or a file."; 
>  } 
>  
> to display a message when there is nothing in both fields 
>  
> help gratefuly requested 
> Ian 
>  
>
 
  
Navigation:
[Reply to this message] 
 |