hi again, im having trouble with the review submission form, is there any reason why this shouldnt work?
PHP Code:
<?
if(isset($_POST['validation'])) {
$username = "";
$password = "";
$database = "";
$name_rev=$_POST['name'];
$email_rev=$_POST['email'];
$rating_rev=$_POST['rating'];
$review_rev=$_POST['review'];
$dbh=mysql_connect ("localhost", "$username", "$password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("gkelly_siteopening");
$query_review = "INSERT INTO restreview VALUES ('$id','$name_rev','$email_rev','$rating_rev','$review_rev')";
mysql_close();
}
?>
<h1>Your Details:</h1>
<form action="product.php?id=<? echo $id; ?>" method="post">
<span class="det">Name:</span> <input style="margin-left: 5px;" type="text" name="name"><br/>
<span class="det">Email:</span> <input style="margin-left: 7px;" type="text" name="email"> <span class="det">(will not be displayed)</span><br/>
<span class="det">Rating:</span> <select name="rating">
<option value="1">1</option>
<option value="2">2</option>
<option value="3" selected="selected">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<br/>
<h1>Review:</h1>
<textarea rows="5" cols="50" name="review">
Enter your review here
</textarea>
<input type="hidden" name="validation" value="1"/>
<p style="margin-left: 50px;" >
<input type="submit" value="Submit" >
<input type="reset" value="Reset">
</p>
</form>
Also how to i get the table to keep any line breaks in the review?
thanks!!