Whenever I run this script I get an parse error on line 53:
<?php
$host = 'localhost';
$user = 'root';
$db = 'chocwilk';
if($HTTP_POST_VARS)
{
?>
<html>
<head>
<?php
mysql_connect($host, $user)
or trigger_error(mysql_error(), E_USER_ERROR);
mysql_select_db($db)
or trigger_error(mysql_error(), E_USER_ERROR);
if($HTTP_POST_VARS['password']!='mypassword')
{
?>
<title>
Wrong Password
</title>
</head>
<body>
<?php
echo $HTTP_POST_VARS['password'];
die("Wrong password!!");
}
else
{
mysql_query("INSERT INTO news SET newsBody='{$HTTP_POST_VARS['news_news']}');
?>
<title>
Add News Successful
</title>
</head>
<body>
New addition succesful
</body>
</html>
<?php
}
}
else
{
?>
<html>
<head>
<title>
Submit News
</title>
</head>
<body>
<form name="news" action="add.php" method="post"> <-- Error here
<textarea name="news_news" rows="20" cols="50">News goes here</textarea><br>
Password:
<input type="password" name="password">
<input type="submit" value="Add News">
</form>
</body>
</html>
<?php
}
?>