$errors = "true"; $errGallons = "Gallons outside acceptable range; 0 - 10,000."; } if ($_POST["octane"] < 87 || $_POST["octane"] > 94) { $errors = "true"; $errOctane = "The only supported octanes are 87 - 94."; } } else { $errors = "true"; $errLogin = "******"; } if ($errors != "true") { // Everything is OK. Do the INSERT: $logRec = new LogRecord(); $logRec->setAutoId($user->getCurrentAutoId()); $logRec->setUserId($user->getUserId()); $logRec->setLogDate($_POST["date"]); $logRec->setOdometer($_POST["odometer"]); $logRec->setGallons($_POST["gallons"]); $logRec->setOctane($_POST["octane"]); $logRecordId = $logRec->writeRecord(); } header("content-type: text/xml"); ?> <AddRecordErrors> <errors><?php echo $errors; ?> </errors>