-1
<?php
session_start();
if (!isset($_SESSION['SESSION']))
require ("session_init.php");
// reset session variables...
$_SESSION['LOGIN_TYPE'] = "";
$_SESSION['USERNAME'] = "";
$_SESSION['LOGGEDIN'] = false;
$_SESSION['FNAME'] = "";
$_SESSION['LNAME'] = "";
// initialize variables...
$username = "";
$password = "";
$email = "";
// make sure post parameters were sent...
if (isset($_REQUEST["username"]))
$username = $_REQUEST["username"];
if (isset($_REQUEST["password"]))
$password = $_REQUEST["password"];
// form variables must have something in them...
if ($username == "" || $password == "") {
header("Location: ../index.php?flg=red&username=" . $username);
exit;
}
// check in database...
$query = "SELECT * FROM user, position WHERE user.positionID = position.positionID AND logonName = ?";
$result = $connect->prepare($query);
$result->execute(array($username));
Error line $result = $connect->prepare($query);
Notice: Undefined variable: connect in C:\xampp\htdocs\CAD3\scripts\loggedin.php on line 46
Fatal error: Call to a member function prepare() on null in C:\xampp\htdocs\CAD3\scripts\loggedin.php on line 46
오류 위의 코드를 테스트하지 않은 것은이 라인에 '$가 발생할 = $으로 연결하는> ($ 쿼리) 준비,' –
을 덕분에 여기에 내 처음이야 –
Notice : 정의되지 않은 변수 : 46 행의 –