<?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
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.