snowboardr
Programmer
new to php its echoing the variable name rather than the list i created...
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]
Code:
$cid = @$_POST["cid"];
$cfirst = @$_POST["cfirst"];
$clast = @$_POST["clast"];
$caddress = @$_POST["caddress"];
$ccity = @$_POST["ccity"];
$cstate = @$_POST["cstate"];
$czip = @$_POST["czip"];
$cphone = @$_POST["cphone"];
$cemail = @$_POST["cemail"];
if (empty($cfirst)) {
$errorlist = 'first name';
}
if (empty($clast)) {
$errorlist .= ' last name';
}
if (empty($caddress)) {
$errorlist .= ' address';
}
if (empty($ccity)) {
$errorlist .= ' city';
}
if (empty($czip)) {
$errorlist .= ' zip';
}
if (empty($cphone)) {
$errorlist .= ' phone';
}
if (empty($cemail)) {
$errorlist .= ' email';
}
if (!(empty($errorlist))) {
$errortmp = trim(errorlist);
$strspace = ' ';
$strReplaceSpace = ', ';
$errortmp = str_ireplace ($strspace,$strReplaceSpace,$errortmp);
$error = 'Error : Fields required : '.$errortmp;
echo $error;
//
}
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]