does anyone know how to fix this..!
im currently a student wanted to learn PHP on my own
so i do some research
and this is my problem i cant fix this
Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\forum\functions.php on line 84
the line 84 is the 2nd curly braces:
- Code: Select all
header("Location: " . $config_basedir . "/login.php?error=1");
}
}
else {
require("header.php");
this is the whole source code for my website
- Code: Select all
<?php
function pf_script_with_get($script) {
$page = $script;
$page = $page . "?";
foreach($_GET as $key => $val) {
$page = $page . $key . "=" . $val . "&";
}
return substr($page, 0, strlen($page)-1);
}
?>
<?php
session_start();
require("config.php");
require("functions.php");
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
if($_POST['submit']) {
$sql = "SELECT * FROM users WHERE username = '"
. $_POST['username'] . "' AND password = '"
. $_POST['password'] . "';";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
if($numrows == 1) {
$row = mysql_fetch_assoc($result);
if($row['active'] == 1) {
session_register("USERNAME");
session_register("USERID");
$_SESSION['USERNAME'] = $row['username'];
$_SESSION['USERID'] = $row['id'];
switch($_GET['ref']) {
case "newpost":
if(isset($_GET['id']) == FALSE) {
header("Location: " . $config_basedir .
"/newtopic.php");
}
else {
header("Location: " . $config_basedir .
"/newtopic.php?id=" . $_GET['id']);
}
break;
case "reply":
if(isset($_GET['id']) == FALSE) {
header("Location: " . $config_basedir .
"/newtopic.php");
}
else {
header("Location: " . $config_basedir .
"/newtopic.php?id=" . $_GET['id']);
}
break;
default:
header("Location: " . $config_basedir);
break;
}
}
else {
require("header.php");
echo "This account is not verified yet. You were emailed a link
to verify the account. Please click on the link in the email to
continue.";
}
echo "This account is not verified yet. You were emailed a link
to verify the account. Please click on the link in the email to
continue.";
}
}
else {
header("Location: " . $config_basedir . "/login.php?error=1");
}
}
else {
require("header.php");
if($_GET['error']) {
echo "Incorrect login, please try again!";
}
?>
<form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>"
method="post">
Don't have an account? Go and <a href="register.php">Register</a>!
<?php
}
require("footer.php");
?>
i forgot to say... im new here... i just got registered recently!


