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

Posted by Ian Davies on 06/26/06 20:54

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'] ='' &&
empty($_FILES['uploadedfile']) || $_FILES['uploadedfile'] ='') {
$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

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