Hi,
i am trying to add a guestbook as indicated in the website http://www.phpeasystep.com/workshopview.php?id=15
All seems to work fine, except 1 small thing. When the user submist the form, 3 of the 5 variables are not shown on the guestbook.
You can try it out at http://www.carmelgcauchi.com/site/guestbook.php
The missing values can be seen at http://www.carmelgcauchi.com/site/viewguestbook.php
Basicall, the name, email and comment are not being returned.
It seems that the php code is submitting only the values that are generated by the database itself to the mySQL database (datetime and ID).
On the mySQL i only see blank entries for name, email and comment.
The code for the addguestbook.php is the following (for obvious reasons i have **** some data)
<?php
$host="**.*.**.***"; // Host name
$username="*****"; // Mysql username
$password="*****"; // Mysql password
$db_name="*****"; // Database name
$tbl_name="guestbook"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect server ");
mysql_select_db("$db_name")or die("cannot select DB");
$datetime=date("y-m-d h:i:s"); //date time
$sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime')";
$result=mysql_query($sql);
//check if query successful
if($result){
echo "Grazzi tal-Mesagg";
echo "<BR>";
echo "<a href='viewguestbook.php'>Ara l-guestbook</a>"; // link to view guestbook page
}
else {
echo "ERROR";
}
mysql_close();
?>