I've written the following function:
function checkdata($infield){
if (!isset($infield) || empty($infield)) {
echo "<br><font color='red'>You must enter a valid" . " " . $infield . " " . "to submit a workorder. Please click <a href= to return to the workorder submission form.</font>";
}
}
When I call it and the variable given for infield is empty, I get the following output:
You must enter a valid to submit a workorder. Please click here to return to the workorder submission form.
As you can see, the variable is not echoed. What am I doing wrong?
Any help is greatly appreciated!
function checkdata($infield){
if (!isset($infield) || empty($infield)) {
echo "<br><font color='red'>You must enter a valid" . " " . $infield . " " . "to submit a workorder. Please click <a href= to return to the workorder submission form.</font>";
}
}
When I call it and the variable given for infield is empty, I get the following output:
You must enter a valid to submit a workorder. Please click here to return to the workorder submission form.
As you can see, the variable is not echoed. What am I doing wrong?
Any help is greatly appreciated!