Hi vaaaska!
Thanks for the tips, I've made a simple comment form which add the comments to mysqldb, table called: xcomments:
<?php
// include the database configuration and
// open connection to database
include 'dbconfig.php';
//Fetch the username
$txtName = $session->username;
$ip = $_SERVER["REMOTE_ADDR"];
$email = $session->userinfo['email'];
// check if the form is submitted
if(isset($_POST['btnSign']))
{
// get the input from $_POST variable
// trim all input to remove extra spaces
$message = trim($_POST['mtxMessage']);
// escape the message ( if it's not already escaped )
if(!get_magic_quotes_gpc())
{
$name = addslashes($name);
$message = addslashes($message);
}
// prepare the query string
$query = "INSERT INTO xcomments (name, email, ip, message, entry_date) " .
"VALUES ('$txtName', '$email', '$ip', '$message', current_date)";
// execute the query to insert the input to database
// if query fail the script will terminate
mysql_query($query) or die('Error, query failed');
// header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
?>
<html>
<head>
</head>
<body>
<form method="post" name="guestform">
<table width="100%" border="1" cellpadding="2" cellspacing="1">
<tr>
<td height="25" colspan="2" valign="top" background="images/border.jpg"> </td>
</tr>
<tr>
<td width="8%" height="83" valign="top" >Comments:<br>
</td>
<td width="80%" valign="top"><textarea name="mtxMessage" style="color: #000000; font-family: Verdana; font-weight: bold; font-size: 10px; background-color: #A5A5D3;" cols="70" rows="5" id="mtxMessage"></textarea></td>
</tr>
<tr>
<td height="33" valign="top" width="8%"> </td>
<td valign="top" width="80%"> <input name="btnSign" type="submit" id="btnSign" value="Add" onClick=""></td>
</tr>
</table>
</form>
</body>
</html>
How to record the image , comments id and grab them while viewing the images? can you please tell me more clearly?
thanks!