Page 1 of 1

Parse error: parse error in \movie\addnews.php on line 75

Posted: Sat Mar 13, 2010 11:30 am
by tito85
What is wrong? Please help!!!

Parse error: parse error in C:\wamp\www\movie\addnews.php on line 75 (Last line)

<?
session_start();
require('config/connection.php');
include('securitycheck.php');
if (isset($_POST['btnCancel']))
{
header('Location: index.php');
}
else if (isset($_POST['btnAddNews']))
{
$title = $_POST['txtTitle'];
$body = $_POST['txtBody'];
if (strlen(trim($title)) > 0 && strlen(trim($body)) > 0)
{
$insert = "INSERT INTO news (title, body, postedon, userid) VALUES ('" . addslashes($title) . "', '" . addslashes($body) . "', '" . date("Y-m-d H:i:s") . "', '" . $_SESSION['userinfo']['id'] . "')";
mysql_query($insert) or die(mysql_error());
header('Location: index.php');
}
else
{
$message = "Error: Both <b>Title</b> and <b>Body</b> are mandatory";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/screen.css" />
<title>Add News</title>
</head>
<body>
<?
if ($isAdmin)
{
?>
<div id="website">
<? include('top.php'); ?>
<div id="content">
<div id="contentleft">
<h2>Add News</h2>
<?
if (isset($message))
{
echo "<center>$message</center>";
unset($message);
}
?>
<form method="post">
<table>
<tr>
<td>
Title
</td>
<td>
<input type="text" style="width: 300px;" name="txtTitle" />
</td>
</tr>
<tr>
<td valign="top">
Body
</td>
<td>
<textarea name="txtBody" rows="7" cols="45"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="btnAddNews" value="Add" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="btnCancel" value="Cancel" />
</td>
</tr>
</table>
</form>
</body>
</html>

Re: Parse error: parse error in \movie\addnews.php on line 7

Posted: Sat Mar 13, 2010 1:12 pm
by McInfo
The block started by this condition is not closed.

Code: Select all

if ($isAdmin)
{
Please use the syntax when posting code.

Edit: This post was recovered from search engine cache.

Re: Parse error: parse error in \movie\addnews.php on line 75

Posted: Mon Mar 15, 2010 2:25 am
by tito85
why i cannot see the other posts posted here?

Re: Parse error: parse error in \movie\addnews.php on line 75

Posted: Mon Mar 15, 2010 4:08 am
by requinix
tito85 wrote:why i cannot see the other posts posted here?
Because something glitched.

Code: Select all

if ($isAdmin)
{
You never closed that.