using this code:
<?PHP
if (!$type || !$year || !$specs) {
echo "You have not entered all the required details.<br>"
."Please go back and try again.";
exit;
}
$type = addslashes($type);
$year = addslashes($year);
$specs = addslashes($specs);
@$db = mysql_pconnect("localhost","***","***");
if (!$db) {
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("surplus");
$query = "insert into surplus values('$type','$year','$specs',NULL)";
$result = mysql_query($query)
or print ">>> MySQL-Error: ".mysql_errno()." -> ".mysql_error()."<br>\n";
if ($result) {
echo mysql_affected_rows()." surplus added to the database.";
}
//If surplus has been deleted,
//remove it from the database.
if (issit($deletesurplus)) {
$sql = "delete from surplus
where ID=$deletesurplus";
if (@mysql_query($sql)) {
echo("<p>The surplus has been deleted.</p>");
} else {
echo("<p>Error deleting surplus: " .
mysql_error() . "</p>");
}
}
echo("<p>Here is all the surplus in our database: " .
"</p>");
//Request the ID and text of all the surplus
$result = @mysql_query(
"select id, specs from surplus");
if (!$result) {
echo("<p>Error performing query: " .
mysql_error() . "</p>");
exit();
}
//Display the text of each item in a paragraph
//with a "delete this item" link next to each.
while ( $row = msql_fetch_array($result) ) {
$surplusid = $row["id"];
$surplustext = $row["specs"];
echo("<p>$surplustext " .
"<a href='$PHP_SELF?deletesurplus=$surplusid'>" .
"Delete this item</a></p>");
endiff;
?>
i am using this code to attempt to display and offer a link to click on that will delete the displayed item from the database.
right now, when executed i get a parse error saying line 205, which is the very last line in the document: </html>
?? help?