<?php
echo "<html>
<head><title>comment box</title></head>
<body>
<hr width=1000>";
require('connect.php');
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$comment = $_POST['comment'];
echo "<font color=white><center>";
$result= mysql_query(" INSERT INTO COMMENT (name,comment) VALUES ('$name','$comment')")
or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo "<tr> <th>ID</th> <th>Name</th> <th>Comment</th></tr>";
echo "<tr>";
echo '<td>' . $row['name'] . '</td>';
echo '<td>' . $row['comment'] . '</td>';
echo "</tr>";
}
echo "</font></center>";
echo "</table>";
}
echo "<center>
<form method='POST' action='photogallery.php'>
<font color=white>Name</font><input type='text' name='name'><br>
<font color=white>Comment</font><textarea cols=30 rows=5 name='comment'></textarea><br>
<input type='submit' name='submit' value='Comment'><br>
</form>
</center>
</center>
</body></html>";
darkiel21
0
Newbie Poster
Recommended Answers
Jump to PostHi darkiel21,
You forgot to say what the problem is
Jump to PostHi, well, just by looking at it, you will need to ECHO out everything, including the form as well. You cannot end with
</html>";
without echo and please use CODE tags.
All 6 Replies
Zagga
darkiel21
0
Newbie Poster
SQLpower
0
Light Poster
darkiel21
0
Newbie Poster
SQLpower
0
Light Poster
karthik_ppts
81
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.