Ev4n
07-25-2008, 07:18 AM
I get this error:
Parse error: syntax error, unexpected $end in C:\Apache2\htdocs\login\index.php on line 38
For this script:
<html>
<head>
<title>
Login
</title>
</head>
<body>
<?php
if(isset($_POST['submit'])) {
$loggedin = FALSE;
$fp = fopen ('users/users.txt', 'rb');
while( $line = fgetcsv ($fp, 100, "\t")) {
if(($line[0] == $_POST['username'])
AND($line[1] == crypt($_POST['password1'], $line[1]) ) ) {
$loggedin = TRUE;
break;
fclose($fp);
if($loggedin) {
print 'You are now logged in.';
}
else {
print 'The username and the password you entered do not match those on file.';
}
} else {
?>
<form action="login.php" method="post">
Username:<br />
<input type="text" name="username" size="20"><br />
Password:<br />
<input type="password" name="password1" size="20"><br />
<input type="submit" name="submit" value="Login">
</form>
<?php
}
?>
</body>
</html>
If you can fix the script it would be a big help
Parse error: syntax error, unexpected $end in C:\Apache2\htdocs\login\index.php on line 38
For this script:
<html>
<head>
<title>
Login
</title>
</head>
<body>
<?php
if(isset($_POST['submit'])) {
$loggedin = FALSE;
$fp = fopen ('users/users.txt', 'rb');
while( $line = fgetcsv ($fp, 100, "\t")) {
if(($line[0] == $_POST['username'])
AND($line[1] == crypt($_POST['password1'], $line[1]) ) ) {
$loggedin = TRUE;
break;
fclose($fp);
if($loggedin) {
print 'You are now logged in.';
}
else {
print 'The username and the password you entered do not match those on file.';
}
} else {
?>
<form action="login.php" method="post">
Username:<br />
<input type="text" name="username" size="20"><br />
Password:<br />
<input type="password" name="password1" size="20"><br />
<input type="submit" name="submit" value="Login">
</form>
<?php
}
?>
</body>
</html>
If you can fix the script it would be a big help