ok i have this code
[code=php]
<?php
include(“header.php”);
$passw=”seltzer”;
if($passw==$password)
{
$_SESSION[‘loggedin’]==”1″;
}
elseif($_SESSION[‘loggedin’]==”1″)
{
$un = “”;
$pass = “”;
$db = “”;
$host = “localhost”;
$sql = mysql_connect($host, $un, $pass) or die(mysql_error());
mysql_select_db($db, $sql) or die(mysql_error());
$query = “SELECT * FROM school ORDER BY `ID` DESC LIMIT 5″;// this makes sure that the newest news is first
$results = mysql_query($query) or die(mysql_error());
echo'<div class=”content”>’;
echo'<div class=”top”>Hw Entries</div>’;
while ($row = mysql_fetch_row($results))
{
echo'<h3>’.$row[1].'</h3><br><p>’.nl2br($row[2]).'</p><br>Added on ’.$row[3].’ |<a class=”menu” href=”entry.php?ID=’.$row[0].’ “>Add/View Comment(s)</a><hr>’;
}
}
else
{
echo”<div class=’content’><div class=’top’>Enter Pass</div><form action=’index.php’ method=’POST’>Enter Password:<input type=’password’ name=’password’><input type=’submit’ name=’submit’></div>”;
}
include(“footer.php”);
?>
I have this code but it doesnt work.
When i go to the page first it displayts the else statement but once hit submit it just displays a blank page. Shouldnt it display my content because $password is equal to $pass
O yeah and the else statement displays until i gett the pass correct.