I'm really sorry for the long code .. but I have no idea where I'm going wrong .. i tried putting all the html into print things but its doing no difference .. when i press submit it says "Review added successfully" but it sent nothing to the mysql db. Can you help me?
add.php:
<?
require 'config.php';
mysql_connect("$server", "$mysqluser", "$mysqlpass")
or die("There was an error connecting to the database. Please inform site admin of this problem.");
mysql_select_db("$dbname");
$confquery = "SELECT * FROM review_conf";
$result = mysql_db_query($dbname, $confquery);
while ($conf = mysql_fetch_assoc($result)) {
print "<html>";
print "<head>";
print "<title>$conf[sitename]'s Review System</title>";
print "</head>";
print "<body>";
print "<table align=center width=90% border=$conf[borderwidth] bgcolor=$conf[bgcolor] cellpadding=4>";
print "<tr><td>";
print "<font face=$conf[font] color=$conf[fontcolor] size=$conf[bigfont]>Add a review</font>";
print "<BR><BR>";
print "<form method=post action=add.php?action=submit>";
print "<input type=text name=subject value=Subject maxlength=50><BR>";
print "<textarea name=review rows=10 cols=50>Type your review here.</textarea><BR>";
print "<input type=text name=rating maxlength=6 value=Rating><BR>";
print "<textarea name=highs cols=50 rows=3>Highs</textarea><BR>";
print "<textarea name=lows cols=50 rows=3>Lows</textarea><BR>";
print "<input type=submit value=Submit>";
print "</form>";
if($action == "submit") {
$querya = "INSERT INTO review_reviews (`subject`, `review`, `rating`, `highs`, `lows`,) VALUES ('$subject', '$review', '$rating', '$highs', '$lows')";
mysql_db_query($dbname, $querya);
print "Review added successfully.";
}
}
?>
</td><td>
</table>
</body>
</html>
config.php (which i know is correct):
<?
$server = "localhost";
$mysqluser = "jcmjx";
$mysqlpass = "****";
$dbname = "jcmjx";
?>