i'm working on a particular page (post.php), but i can't seem to get the php to parse. if you looked at the source code, you'd find that it reads like this:
<html>
<head>
<title>Post Comment</title>
</head>
<body>
<p><center><b>Add a Comment</b></center></p>
<?php
//create short variable names
$name=$HTTP_POST_VARS['name'];
$email=$HTTP_POST_VARS['email'];
$comment=$HTTP_POST_VARS['comment'];
if (!$name || !$email || !$comment)
{
echo 'You have not filled in all the fields. Please go <a href="post.html">back</a> and try again.';
exit;
}
@$db = mysql_connect('host', 'username', 'pword');
if(!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db ('database');
$query = "insert into phpguest_entries values
('".$name."', '".$email."', '".$comment."')";
$result = mysql_query($query);
if ($result)
{
echo 'Your comment has been successfully added.';
}
else
{
echo 'There has been an error in adding your comment. Please go <a href="post.html">back</a> and try again.';
exit;
}
?>
</body>
</html>
which is not cool. i changed the actual passwords and db names, but if you knew the page, you could easily just find out.
can you all help me get this fixed up??? i don't know why it's not parsing the code... i have other pages that have absolutely no problem with the code. any clues???
😕 🙁
-- Cm