$s['body'] = trim($_POST['status']); $s['type'] = "status"; } // hotlist (optional) if (isset($_POST['hotlist']) && trim($_POST['hotlist']) != '') { // this is special -- need to create a followup. $h['body'] = trim($_POST['hotlist']); $h['type'] = "hotlist"; } $incidentid = 0; // no errors? if ($errors == '') { // fill in a couple more things $i['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $i['reportingip'] = getenv('REMOTE_ADDR'); $incidentid = $irtdb->addIncident($i); if ($incidentid > 0) { if (!empty($h)) { $h['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $h['reportingip'] = getenv('REMOTE_ADDR'); $irtdb->addFollowup($incidentid, $h); } if (!empty($s)) { $s['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $s['reportingip'] = getenv('REMOTE_ADDR'); $irtdb->addFollowup($incidentid, $s); } } header("REFRESH: 0;idetail.php?i={$incidentid}"); } }