setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo "

Error!: " . $e->getMessage() . "

"; die(); } # SHOLUD SOMETHING BE APPROVED? if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['id']) ) { $stmt = $conn->prepare("UPDATE activities SET approved = true WHERE id=:id"); echo "lol:" . $_POST['id']; $stmt->bindParam(':id', $_POST['id']); $stmt->execute(); } # IS LOGIN LEGITIMATE? if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['email']) && isset($_POST['password'])) { try { $stmt = $conn->prepare("SELECT * FROM admins WHERE email=:email"); $stmt->bindParam(':email', $_POST['email']); $stmt->execute(); $row = $stmt->fetch(); if (password_verify($_POST['password'], $row['password'])){ $_SESSION['admin'] = true; } else { $_SESSION['admin'] = false; } } catch (PDOException $e) { echo "

Error!: " . $e->getMessage() . "

"; } } ?> Yota Callplan
YOTA
'; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; foreach($conn->query("SELECT * FROM activities WHERE approved = false") as $row) { echo ""; echo ""; echo ""; echo ""; echo ''; echo "\n"; } echo "
ImePrezimeGodineActions
" . $row['name'] . "" . $row['surname'] . "" . $row['age'] . "
'; echo ''; echo ''; echo '
\n\n"; } catch (PDOException $e) { echo "

Error!: " . $e->getMessage() . "

"; } } else { # Bad pass check... if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_SESSION['admin']) && $_SESSION['admin'] == false) echo "Bad credentials!"; # Login form echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; } ?>