Files
cs157AOnlineBanking/f8l_exception/includes/inc_validateInput.php
joeyajames e211bb797e Working website, Rev 1.
Register user, login, chg pw, reset pw, view accounts, all work. Can't
create a new account yet.
2014-11-11 20:20:05 -08:00

20 lines
361 B
PHP

<?php
function validateInput($data, $fieldName)
{
global $errorMessage;
global $errorCount;
if (empty($data))
{
$errorMessage .= $fieldName . " is a required field.<br />\n";
$errorCount++;
$retval = "";
}
else
{
// only clean up the input if it isn't empty
$retval = trim($data);
$retval = stripslashes($retval);
}
return ($retval);
}
?>