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" /> <input type="submit" name="btnCancel" value="Cancel" />
</td>
</tr>
</table>
</form>
</body>
</html>
Parse error: parse error in \movie\addnews.php on line 75
Moderator: General Moderators
Re: Parse error: parse error in \movie\addnews.php on line 7
The block started by this condition is not closed.
Please use the syntax when posting code.
Edit: This post was recovered from search engine cache.
Code: Select all
if ($isAdmin)
{Code: Select all
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 5:30 pm, edited 1 time in total.
Re: Parse error: parse error in \movie\addnews.php on line 75
why i cannot see the other posts posted here?
Last edited by tito85 on Mon Mar 15, 2010 7:28 am, edited 1 time in total.
Re: Parse error: parse error in \movie\addnews.php on line 75
Because something glitched.tito85 wrote:why i cannot see the other posts posted here?
Code: Select all
if ($isAdmin)
{