Does anyone see anything wrong with this code??
it goes right to the "sorry" line and i'm logged in nas "test" and editing the post which has the username of "test" in it's row
<?php
session_start();
if (!$_SESSION["valid_user"])
{
// User not logged in, redirect to login page
Header("Location: ../login.php");
}
?>
<?php
mysql_connect (localhost, test, test);
mysql_select_db (test);
$result = mysql_query ("SELECT * From forum_posts where id = $id");
$row = mysql_fetch_array($result);
?>
<body>
<?php
if ($row["username"] == (!$_SESSION["valid_user"]))
{
?>
<form method="POST" action="editing.php?main_id=<?php echo $row2["main_id"];?>&thead_id=<?php echo $row2["thread_id"];?>&id=<?php echo $row2["id"];?>">
<font size="2" face="Verdana"><?php echo "USER: " . $_SESSION["valid_user"]; ?> <p></p>
<font size="2" face="Verdana">This post is being added in the <?php echo $row2["topic_name"]; ?>
</font>
<p>
<font face="Verdana">
<input type="text" name="title" size="94" style="border-style: solid; border-width: 1px"></font></p>
<p>
<font face="Verdana">
<textarea rows="18" name="body" cols="81" style="border-style: solid; border-width: 1px"></textarea></font></p>
<p>
<font face="Verdana">
<input type="hidden" name="redirect" value="<? echo $ref; ?>">
<input type="hidden" value="6" name="timezone[]" checked>
<input type="submit" value="Submit" name="B1" style="border-style: solid; border-width: 1px"></font></p>
</form>
<?php
} else {
?>
Sorry
<?php
}
?>
</body>
</html>