function saveMessage($option) { global $database, $mainframe, $my; josSpoofCheck(); $row = new mosMessage($database); if (!$row->bind($_POST)) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } if (!$row->check()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } if (!$row->send()) { mosRedirect('index2.php?option=com_messages&mosmsg=' . $row->getError()); } mosRedirect('index2.php?option=com_messages'); }