my friend has been working on this simple code to leave comments on a site for 12 hours now... i hope you guys can help
this is the code:
<?php
$username="root";
$password="";
$database="critic";
$first=$POST['Name'];
$last=$POST['Lastname'];
$comment=$_POST['Comment'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
{
$query = "INSERT INTO critic VALUES ('','$first','$last','$comment')";
mysql_query($query);
while($row = mysql_fetch_assoc($result)){
echo "<div class=\"messages\">";
echo $row['Name'] ." ";
echo $row['Lastname'] ." ";
echo $row['Comment'] ." ";
echo "</div>";
}
mysql_close();
?>
but she says she gets an error for variables like Name, Lastname, Comments
error: Undefined Index
and she says that the names are exactly like in the database.
please help with this, its kinda urgent 😛
thanks in advance 😃
ps. i think she uses drupal and easyPHP, dont know it that info was needed