Dynadot

Can someone try and spot an error in this for me please?

Spaceship
Watch
Impact
20
ok creating a user system and ive got the code layed out but it ays this error

Parse error: parse error, unexpected $end in f:binapacheapachehtdocsnew scriptinhuser systemnew folderlogin.php on line 43
so im asuimg ive either missed a $ or a ; somewhere but i cannot see it

line 43 is the last line of code
PHP:
<?php
//Check for required feilds from form
if ((!$_POST[username]) || (!$_POST[password])) {
header("Location: login.php");
exit;
}

//connect to server and database
$conn = mysql_connect("localhost", "adam123", "adam123") or die(mysql_error());
mysql_select_db("contentsystem",$conn) or die(mysql_error());

//create and login
$sql = "SELECT f_name, l_name FROM auth_users WHERE username = '$_POST[username]' AND password = password('$_POST[password]')";
$result = mysql_query($sql,$conn) or die(mysql_error());

//get the number of rows in the rsult set; should be 1 if a match
if (mysql_num_rows($result) == 1) {

//if authorized, get the values of names
$f_name = mysql_result($result, 0, 'f_name');
$l_name = mysql_result($result, 0, 'l_name');
	
// Cookie
setcookie("auth", "1", 0, "/", "adamuk.serveftp.com", 0);

//echo success
$msg = "you are logged in";
$msg .= "<a href='secret.php'>secret.php</a>";

} else {
//redirect to login page if auth failed
echo "****";
?>


thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
PHP:
} else {
//redirect to login page if auth failed
echo "****";
}
?>

Try it like that. :D
 
0
•••
ah yeh that actually is a swear word but it filtered it
 
0
•••
god im a burk i didnt even see what you added lol
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back