PHPに新しい、ログインスクリプトを実装しました。PHP - ログインしていない場合、ページへのアクセスを拒否する
私はあらかじめ定義された少数の人からの内部サイトとして登録していないので、データベースにパスワードをあらかじめ定義しています。
すべてのは、彼らがログインできるとアウト、しかし、あなたがログインしていない場合、私は見えたくないページがあります[OK]を働いている。
彼らは方法私はこのことについて行っているが、本質的かどうかをチェックされます彼らはログインしていて、そうであれば、クリックされるリンクにhtmlを表示します。しかし、私は、コンソールでエラーが発生します。
キャッチされないでSyntaxError:予期しないトークン}
私のindex.php
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true)
{
echo "<div class='mainContainer' align='center'>
<div class='noteSelectionBoxContainer'>
<div class='custom-font' id='note-header-text'>
Choose your Note Category... <br />
</div>
<div onclick='location.href='general_notes.php';' class='noteSelectionBox hvr-bounce-to-top1' id='selection-box1'>
<div class='vertical-align-content'>
<div class='noSelect'>
<div class='noteboxText custom-font'>GENERAL NOTES</div>
</div>
</div>
</div>
<div onclick='location.href='template_notes.php';' class='noteSelectionBox hvr-bounce-to-top2' id='selection-box2'>
<div class='vertical-align-content'>
<div class='noSelect'>
<div class='noteboxText custom-font'>TEMPLATE NOTES</div>
</div>
</div>
</div>
<div onclick='location.href='variable_notes.php';' class='noteSelectionBox hvr-bounce-to-top3' id='selection-box3'>
<div class='vertical-align-content'>
<div class='noSelect'>
<div class='noteboxText custom-font'>REPLACE VARIABLES</div>
</div>
</div>
</div>
</div>
</div>";
}
else
{
echo "<div class='custom-font' style='font-size: 18px;'> Please log in to view the note categories.</div>";
}
?>
通常、私はdiv要素とでonclickのキックをクリックすることができます定義された場所に私を送ってください。
なぜそれが捕捉されないでSyntaxErrorを言っている:予期しないトークンを}
まだエラー 捕捉されないでSyntaxErrorを取得イムと花茎必要があるので、あなたはインラインJavaScriptを持っている、そしてそれは、単一引用符内の単一引用符を持っている:無効または予期しないトークン –