This is the error i am getting
Parse error: parse error, unexpected ‘{’ in C:wampwwwHTMLloggedin.php
This is the code and there is >> where it says the error is.
[php]
/ If no session is present, redirect the user.
if (!isset($_SESSION[‘username’])) {
//header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/logout.php");
}
if(isset($_POST[‘submit’])) {
require_once (‘includes/mysql_connect.php’);
function escape_data ($data) {
global $dbc;
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string($data, $dbc);
}
$message = NULL;
if (empty($_POST['comment'])) {
$c = FALSE;
$message .= '<p>You forgot to enter your username!</p>';
} else {
$c = escape_data($_POST['comment']);
}
if ($c) {
$query = "INSERT INTO comment (comment, userid, datetime) VALUES ('$c', '$u', NOW())";
$result = @mysql_query ($query);
if (mysql_affected_rows() >0 {
echo ’ ', ‘The Comment was Added’, ‘’;
} else {
$message .= ‘Please try again.
’;
}
}}
[/php]
**Mod Edit - Added PHP tags for readability!