Good Afternoon,
Is it possible for anyone out there to spot our why this piece of code is NOT carrying or the sql statement even though the cookie does exist? please Help
if (!$conn = new COM("ADODB.Connection"))
exit("Unable to create an ADODB connection");
$user = $HTTP_COOKIE_VARS[userName];
$topic = $_POST['topic'];
$comment = $_POST['comment'];
$password = $_POST['password'];
$submit = $_POST['submit'];
if(isset($_COOKIE['userName']) && isset($submit)){
$strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("insert.mdb");
$conn->open($strConn);
$sql=("INSERT INTO comments (comment, user) VALUES ('$comment', '$user')");
$result = $conn->Execute($sql);
die ("<META http-equiv=\"Refresh\" content=\"0;url=view-blog.php\">");
exit();
}
else {
echo 'PLEASE LOGIN FIRST';
echo ($user); // Testing if the USER variable is set for query use
echo ($sql); // Trying to echo the sql statement to see if its right
}
?>
Thanks for you help!
__________________
Is it possible for anyone out there to spot our why this piece of code is NOT carrying or the sql statement even though the cookie does exist? please Help
if (!$conn = new COM("ADODB.Connection"))
exit("Unable to create an ADODB connection");
$user = $HTTP_COOKIE_VARS[userName];
$topic = $_POST['topic'];
$comment = $_POST['comment'];
$password = $_POST['password'];
$submit = $_POST['submit'];
if(isset($_COOKIE['userName']) && isset($submit)){
$strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("insert.mdb");
$conn->open($strConn);
$sql=("INSERT INTO comments (comment, user) VALUES ('$comment', '$user')");
$result = $conn->Execute($sql);
die ("<META http-equiv=\"Refresh\" content=\"0;url=view-blog.php\">");
exit();
}
else {
echo 'PLEASE LOGIN FIRST';
echo ($user); // Testing if the USER variable is set for query use
echo ($sql); // Trying to echo the sql statement to see if its right
}
?>
Thanks for you help!
__________________