I am attempting to write a blog script for my site, and this is the page to login to add a new post.
CODE
<?php
if (isset($_POST['username']) && isset($_POST['password']) {
include ("settings.php");
$u = $_POST['username'];
$p = $_POST['password'];
if ($u == $usercheck && $p == $passcheck) {
echo "<script language=\"javascript\" type=\"text/javascript\">
window.location=\"?bpage=addpost\";
</script>";
}
else {
die ("Incorrect username or password.");
}
}
else {
?>
<h3>Login to Add a New Post</h3>
<br>
<form method="POST" action="<?php $_SERVER['php-self']; ?>">
<h4>Username</h4>
<input type="text" name="username" />
<br>
<h4>Password</h4>
<input type="password" name="password" />
<br>
<input type="submit" value="Login" />
</form>
<?php
}
?>
Whenever I try to run it, I get the error "Parse error: syntax error, unexpected '{' in /homepages/19/d224217279/htdocs/eric/blog/login.php on line 2". How can I fix this? I don't see whats wrong here.