Here is the problem?
I have a link on one page that passes a $num variable to this file (which it does fine). Then this file 1st of all needs a password to get to main area. Having trouble passing $num variable thru the password part. Because when it does the query, all I get is Resource ID #5
<?
// Defines password
$password = "change";
// Checks Password
if ($_POST['txtPassword'] != $password) {
?>
<html>
<head>
<title>Comment Login</title>
</head>
<body bgcolor=#3C507D>
<center>
<form name="form" method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="num" value="<? echo "$num"; ?>">
<input type="password" title="Enter your password" name="txtPassword"><br><br>
<input type="submit" name="Submit" value="Login">
</form>
</center>
<?
} else {
include ("conf.php");
mysql_connect ("localhost", "$sqlname", "$sqlpw") or die ("Could not connect"); # connect mySQL
mysql_select_db("$sqldb"); # select database
$query = "SELECT reply FROM eg_book WHERE (num = '$num')";
$result = mysql_query ($query);
echo "$result";
?>
<title>Please Comment</title>
<body bgcolor=#3C507D>
<center>
<font color="#FFFFFF">Administrators Comment</font><br>
<form name="form1" method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="num" value="<? echo "$num"; ?>">
<textarea rows="10" name="reply" cols="60" style="font-family: Verdana; font-size: 10px"><? echo "$result"; ?></textarea><br><br>
<input type="submit" name="Submit" value="Add Comment">
</form>
</center>
</body>
</html>
<?
mysql_query("UPDATE eg_book SET reply = '$reply' WHERE (num = '$num')") or die("MYSQL Returned: " . mysql_error());
}
?>
My mind is so jumbled right now, and I can't think straight, can anyone help out this poor sap, LOL
Thanks