You are here: Re: testing the condition of a pair of fields « All PHP « IT news, forums, messages
Re: testing the condition of a pair of fields

Posted by Guy on 10/10/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация