Hi, I'm attempting to make a log in system for a forum I made.
I have it set up so when a user types in a registered username/password, variables are assigned temporary values untill the page is refreshed, which will then set the values as cookies and reset the temporary values to be empty. Will this work? Is there a better way to do it? I keep getting an error whenever I try:
When the user enters a valid username password the system, it assigns the variables...
if (($result["username1"] == $username) AND ($result["password1"] == $password) AND ($username != "") AND ($password != "")) {
echo " Log In sucessful! Welcome $username!!!";
$TempUserName = $result["username1"];
$TempUserPassword = $result["password1"];
$TempUserEmail = $result["userEmail1"];
$temploggedIn = "YES";
} else { ... /** log in error */ }
After the page is refreshed, I keep getting a parse error at line 30 (<style type="text/css">)
Any ideas?
<?
if ($temploggedIn == "YES") {
setcookie ($TempUserName, $username1234567898);
setcookie ($TempUserPassword, $password1234567898);
setcookie ($TempUserEmail, $website1234567898);
setcookie ($temploggedIn, $loggedin1234567898);
$TempUserName = "";
$TempUserPassword = "";
$TempUserEmail = "";
$temploggedIn = "";
}
?>
<html>
<head> <nobanner> <title> Forum </title>
<style type="text/css">
table{border-collapse:collapse;padding:0;}
td#three{width:830px;border-collapse:collapse;padding:0;background-color:#000000;vertical-align:text-top;}
BODY{
scrollbar-face-color:#10314A;
scrollbar-arrow-color:#9900FF;
scrollbar-track-color:#173e66;
scrollbar-shadow-color:#9900FF;
scrollbar-highlight-color:#000099;
scrollbar-3dlight-color:#9900FF;
scrollbar-darkshadow-Color:#000000;
}
a { text-decoration: none }
</style>
</head>
<body BGCOLOR="000000" BACKGROUND LINK="#CCCCCC" VLINK="#CCCCCC" ALINK="#FFFF00">can we ssee all the code becaus eit is hard to tell which is line 30. line 30 in that will not cause a parse error. something else is ding it.i think one error is:
a { text-decoration: none }
should read
a { text-decoration: none; }if you get a parse error than you have an error in your php code not your html or your css.
please post at least the first 30 line your your script...Originally posted by Guitardy
i think one error is:
a { text-decoration: none }
should read
a { text-decoration: none; }
that is not an error, nice try though
I have it set up so when a user types in a registered username/password, variables are assigned temporary values untill the page is refreshed, which will then set the values as cookies and reset the temporary values to be empty. Will this work? Is there a better way to do it? I keep getting an error whenever I try:
When the user enters a valid username password the system, it assigns the variables...
if (($result["username1"] == $username) AND ($result["password1"] == $password) AND ($username != "") AND ($password != "")) {
echo " Log In sucessful! Welcome $username!!!";
$TempUserName = $result["username1"];
$TempUserPassword = $result["password1"];
$TempUserEmail = $result["userEmail1"];
$temploggedIn = "YES";
} else { ... /** log in error */ }
After the page is refreshed, I keep getting a parse error at line 30 (<style type="text/css">)
Any ideas?
<?
if ($temploggedIn == "YES") {
setcookie ($TempUserName, $username1234567898);
setcookie ($TempUserPassword, $password1234567898);
setcookie ($TempUserEmail, $website1234567898);
setcookie ($temploggedIn, $loggedin1234567898);
$TempUserName = "";
$TempUserPassword = "";
$TempUserEmail = "";
$temploggedIn = "";
}
?>
<html>
<head> <nobanner> <title> Forum </title>
<style type="text/css">
table{border-collapse:collapse;padding:0;}
td#three{width:830px;border-collapse:collapse;padding:0;background-color:#000000;vertical-align:text-top;}
BODY{
scrollbar-face-color:#10314A;
scrollbar-arrow-color:#9900FF;
scrollbar-track-color:#173e66;
scrollbar-shadow-color:#9900FF;
scrollbar-highlight-color:#000099;
scrollbar-3dlight-color:#9900FF;
scrollbar-darkshadow-Color:#000000;
}
a { text-decoration: none }
</style>
</head>
<body BGCOLOR="000000" BACKGROUND LINK="#CCCCCC" VLINK="#CCCCCC" ALINK="#FFFF00">can we ssee all the code becaus eit is hard to tell which is line 30. line 30 in that will not cause a parse error. something else is ding it.i think one error is:
a { text-decoration: none }
should read
a { text-decoration: none; }if you get a parse error than you have an error in your php code not your html or your css.
please post at least the first 30 line your your script...Originally posted by Guitardy
i think one error is:
a { text-decoration: none }
should read
a { text-decoration: none; }
that is not an error, nice try though