-1

取得エラー: 解析エラー: 構文エラー、47 行目の C:\wamp\www\login.php の予期しない T_EXIT。助けが必要です。昨日は稼働していた

<?php

require_once("config.php");

$email=$_POST['email'];
$password=$_POST['password'];

$email = stripslashes($email);
$password = stripslashes($password);
$email = mysql_real_escape_string(strip_tags($email));
$password = mysql_real_escape_string(strip_tags($password));

// Check occurence of email password combination
$sql="SELECT * FROM register WHERE email='$email'";
$result=mysql_query($sql); 


// Mysql_num_row is counting table row
$count=mysql_num_rows($result);

// If result matched $email, table row must be 1 row
if($count==1)
{
$row = mysql_fetch_array($result);
if($password == $row['password'])
{
session_start();
$_SESSION['login'] = "1";
header("location:home.html");
exit;
}
else 
{
echo "Please enter correct Password";
header("location:login.html");
session_start();
$_SESSION['login'] = '' 
exit();
}
 }  
else
{
header("Location:register.html");
exit();
}

?>

また、次のスニペットを home.php に追加しましたが、ログイン セッションを使用できません

<?php

session_start();
require_once("config.php");

if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {

header ("Location: login.html");

exit;

}
?>
4

1 に答える 1

6

を忘れました;:

echo "Please enter correct Password";
header("location:login.html");
session_start();
$_SESSION['login'] = ''    // <----here
exit();

これはおそらく昨日は機能していなかった可能性があるため、このスクリプトは何か変更されています...

于 2013-04-16T16:19:20.060 に答える