Reply to Problem with an array

Your name:

Reply:


Posted by Phil Latio on 12/18/06 08:25

I have the following line:

if($newValidate->isNotEmpty($this->userName) &&
$newValidate->isNotEmpty($this->passWord))

which checks to see if two text boxes contain any data. However if both
boxes are empty, it only displays the error message once. Below is the
Validate class.

<?php

class Validate
{
private $valueToCheck;
private $errorMessage;

function printErrorMessage ()
{
print $this->errorMessage[0];
print $this->errorMessage[1];
}

function isNotEmpty($valueToCheck)
{
if (!empty($valueToCheck))
{
return TRUE;
}
else
{
$message = "A field is empty.";
$this->errorMessage[] = $message;
return FALSE;
}
}
}
?>

[Back to original 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

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