Example #1
0
function headerElements($el, $mp = '')
{
    if (is_array($el)) {
        foreach ($el as $row) {
            $ex = 'SELECT * FROM `header_tags` WHERE `tags`="' . $row . '" AND `mp_name`="' . $mp . '"';
            $tags = getOnedb($ex);
            if (empty($tags->id)) {
                $ins = 'INSERT INTO `header_tags`(`tags`,`mp_name`)' . 'VALUES' . '("' . dbstring($row) . '","' . $mp . '")';
                insert($ins);
            }
        }
    } else {
        $text = lText('elementi unda iyos array');
        $type = 1;
        sendText($text, $mtype);
        return true;
    }
}
Example #2
0
 public function login($post)
 {
     if (isset($post['post'])) {
         $sql = 'SELECT * FROM `users` WHERE `mail`="' . dbstring($post['mail']) . '" AND `password` = "' . md5($post['password']) . '" ORDER BY `id` DESC LIMIT 1';
         $res = getOnedb($sql);
         if (isset($res->id)) {
             $text = lText('tqven warmatebit gaiaret avtorizacia!');
             //message type success
             $mtype = 2;
             $_SESSION['mail'] = $post['mail'];
         } else {
             $text = lText('paroli da maili sheusabamoa!');
             $mtype = 1;
         }
     }
     sendText($text, $mtype);
     if ($mtype != 2) {
         $link = getLink('?mp=login');
     } else {
         $link = getLink('?');
     }
     redirect($link);
     return true;
 }