Пример #1
0
 function checkUser($sid)
 {
     $STH = $this->db->DBH->prepare("SELECT * FROM users WHERE email=? and activation=?");
     $activation = 1;
     $STH->bindParam(1, $this->email);
     $STH->bindParam(2, $activation);
     $STH->execute();
     $STH->setFetchMode(PDO::FETCH_ASSOC);
     $myrow = $STH->fetch();
     if ($this->password == $myrow['password']) {
         $_SESSION['email'] = $myrow['email'];
         $visited = new Visited($myrow['id'], $sid, $this->db);
         $online = new Online($myrow['id'], $sid, $this->db);
         $visited->setArr();
         $visited->set();
         $online->setArr();
         $online->set();
         echo "<html><head>\n\t\t\t<meta http-equiv='refresh' content='0; url=" . $_SERVER['HTTP_REFERER'] . "'>\n\t\t\t</head>\n\t\t\t</html>";
     } else {
         exit("<html><head><meta http-equiv='refresh' content='3; url=" . $_SERVER['HTTP_REFERER'] . "'></head><body>Извините, введённый вами email или пароль неверный.</body></html>");
     }
 }
Пример #2
0
            	</div>
            	<div class="leftBlockFooter"></div>
    		</div>
    	</div>
        <div class='leftBlock'>
            <div class="leftBlockHeader">Статистика посещений</div>
            <div class="leftBlockContent">
            	<div class="leftBlockContentOpacity"></div>
           		<div class="leftContent">
                	<p>Сейчас онлайн:</p>
                    	<div id="visited">
						<?
							$online = new Online($user->id,session_id(),$db);
							if (isset($_SESSION['email'])) {
								$online->setArr();
								$online->set();
							}
							$online->loginsOnline();
							$online->get();
						?>
                    	</div>
					<p>Нас сегодня посетили:</p>
                    	<div id="visited">
						<?
							$visited = new Visited($user->id,null,$db);
							if (isset($_SESSION['email'])) {
								$visited->setArr();
								$visited->set();
							}
							$visited->get();
							$visited->del();