session_start(); require("database.php"); if ($_POST["dopost"] == "1") { $_SESSION["logged"] = false; $_SESSION["email"] = ""; } if ($_SESSION["logged"] != true) { $email = $_POST["email"]; $password = md5(strtoupper($_POST["password"])); $query = "select count(*) from `people` where `email`='$email' and `password`='$password' and enabled='1';"; $result = mysql_query($query) or die("Error during MySQL transation: " . mysql_error()); $row = mysql_fetch_row($result); if ($row[0] != 1) { die('Sorry: session expired, account not found or not enabled, or invalid password. Please log in.'); } $_SESSION["logged"] = true; $_SESSION["email"] = $email; } $email = $_SESSION["email"]; $query = "select `comment` from `people` where `email`='$email';"; $result = mysql_query($query) or die("Error during MySQL transation: " . mysql_error()); $row = mysql_fetch_row($result); $comment = htmlentities($row[0]); $query = "select * from `people` where `enabled`=1;"; $result = mysql_query($query) or die("Error during MySQL transation: " . mysql_error()); ?>
| Fullname | Comments | |
|---|---|---|
| echo $row["email"]; ?> | echo htmlentities($row["comment"]); ?> |