|
need help with "Parse error: parse error, unexpected T_STRING"
I am very new to the world of programming, and am in the process of teaching myself code. I'm not entirely sure if this is the right place to ask, but here goes (I think it's a pretty simple question, I just don't know the answer)...
This is the code I'm working on (with PHP, and all sensitive password info removed):
<html>
<head>
<title>Bangladesh - Add Indicators</title>
</head>
<body>
<?php // THIS SCRIPT ADDS INDICATORS TO THE BANGLADESH PAGE
//ERROR HANDLING
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
if (isset ($_POST['submit'])) { // HANDLE THE FORM
// CONNECT AND SELECT
if ($dbc = @mysql_connect
('xxxxxxxxxxxx', 'xxxx', 'xxx'))
{
if (!@mysql_select_db ('jcoonro_programs'))
{
die ('<p>Could not select the database because: <b>' .
mysql_error() . '</b></p>');
}
} else {
die ('<p>Could not connect to MySQL because: <b>' .
mysql_error() . '</b></p>');
}
// DEFINE THE QUERY
$query = "INSERT INTO bg_indicator
(bg_ind_id, bg_indicator)
VALUES (1, '{$_POST['bg_indicator']}');
// EXECUTE THE QUERY
if (@mysql_query ($query)) {
print '<p> The new indicator has been added. </p>';
} else {
print '<p>Unable to add the indicator because: <b>' . mysql_error() .
'</b>. The query was $query.</p>';
}
mysql_close();
}
?>
<form action="bg_add_indicator.php" method="post">
<p>Indicator: <input type="text" name="bg_indicator" size="40" maxsize="100" /></p>
<input type="submit" name="submit" value="Add Indicator" />
</form>
</body>
</html>
That there is the code. I am receiving the error message:
parse error: parse error, unexpected T_STRING in /hsphere/local/home/jcoonrod/end-hunger.info/thpud/bg_add_indicator.php on line 59
in which line 59 is: <form action="bg_add_indicator.php" method="post">
Is this just an html problem? If so, I can't figure out what I did incorrectly. I am generally being driven crazy, and any help would be appreciated.
|