No matte rhwta I try, I always get a parse error at line 107 (it will be marked)
<?
session_start();
// check session variable
if (session_is_registered("valid_user"))
{
?>
<html>
<HEAD>
<!-- #BeginEditable "doctitle" -->
<TITLE>Admin Panel</TITLE>
<!-- #EndEditable -->
<style type="text/css"><!--
body {
scrollbar-face-color: 475059;
scrollbar-shadow-color: B8C2CC;
scrollbar-highlight-color: B8C2CC;
scrollbar-3dlight-color: 000000;
scrollbar-darkshadow-color: 000000;
scrollbar-track-color: 262D34;
scrollbar-arrow-color: F2F5FF; }
//--></style>
<style type="text/css"><!--
body {
scrollbar-face-color: #475059;
scrollbar-shadow-color: #B8C2CC;
scrollbar-highlight-color: #B8C2CC;
scrollbar-3dlight-color: #000000;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #262D34;
scrollbar-arrow-color: #F2F5FF; }
//--></style>
<STYLE TYPE="text/css">
<!--
A {text-decoration: none;; color: C3CED9}
A:hover {color:E5F2FF;; text-decoration: none}
h1 { font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: 828E99; font-weight: normal}
h2 { font-family: Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold; color: #FFFFFF}
h3 { font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #CCCCCC; font-weight: normal}
td { font-family: Arial, Helvetica, sans-serif; font-size: 9px; font-weight: normal; color: 828E99}
-->
</STYLE>
</HEAD>
<body background="images/index_table1back2.gif">
<!-- standard page header begins -->
<h1> <h1>
<table width="500" cellspacing="0" cellpadding="5">
<tr>
<td></td>
</tr>
<tr>
<td><h2><b>News</b></h2></td>
</tr>
</table>
<!-- standard page header ends -->
if (!$submit)
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "SELECT news_headline, news_content, news_contact, news_email FROM pfmnews WHERE news_id = '$id'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if a result is returned
if (mysql_num_rows($result) > 0)
{
// turn it into an object
$row = mysql_fetch_object($result);
// print form with values pre-filled
?>
<table cellspacing="5" cellpadding="5">
<form action="<? echo $PHP_SELF; ?>" method="POST">
<tr>
<h1><td valign="top">Headline</td></h1>
<td><input size="50" maxlength="255" type="text" name="news_headline" value=<? echo $row->news_headline; ?>></td>
</tr>
<tr>
<h1><td valign="top">News Content</td></h1>
<td><textarea cols=50 rows=4 name="news_content" value=<? echo $row->news_content; ?>></textarea></td>
</tr>
<tr>
<h1><td valign="top">Name</td></h1>
<td><input size="50" maxlength="255" type="text" name="news_contact" value=<? echo $row->news_contact; ?>></td>
</tr>
<tr>
<h1><td valign="top">E-Mail</td></h1>
<td><input size="50" maxlength="50" type="text" name="news_email" value=<? echo $row->news_email; ?>></td>
</tr>
<tr>
<td colspan=2><input type="Submit" name="submit" value="Submit"></td>
</tr>
</form>
</table>
<?
}
else
{
echo "<h1>Could not locate that post in database</h1>";
}
} // line 107
else
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "UPDATE pfmnews SET news_headline = '$news_headline', news_content = '$news_content', news_contact = '$news_contact', news_emain = '$news_e-mail', timestamp = NOW() WHERE news_id = '$id'";
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());
// print result
echo "<h1>Update successful.</h1>";
// close database connection
mysql_close($connection);
}
?>
</body>
</html>
<?
}
else
{
echo "<h1>You are not logged in as the administrator. Please try again.</h1>";
}
?>
Thanks in advance if you can help