Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addData($userName, $userMail, $type, $warningLevel, $text)
- {
- $type= (int)$type;
- $warningLevel = (int)$warningLevel;
- $userName = htmlspecialchars(mb_substr($userName, 0, MAXSIZE_USERNAME), ENT_QUOTES);
- $userMail = htmlspecialchars(mb_substr($userMail, 0, MAXSIZE_USERMAIL), ENT_QUOTES);
- $text = BBCode(getTextWithBr(htmlspecialchars(mb_substr($text, 0, MAXSIZE_COMMENT), ENT_QUOTES)));
- if (empty($userName) || empty($userMail) || empty($text))
- {
- return RESULT_EMPTYTEXT;
- }
- else
- {
- if (validate(VALID_MAIL, $userMail))
- {
- $add = mysql_query("INSERT INTO `data` VALUES ('', '".$userName."', '".$userMail."', '".$_SERVER["REMOTE_ADDR"]."', '".time()."', '".$warningLevel."', '".$text."', '0', '".$type."')");
- if ($add)
- {
- return RESULT_OK;
- }
- else
- {
- return RESULT_MYSQLERROR;
- }
- }
- else
- {
- return RESULT_DONTVALIDMAIL;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment