<?php
$queryA = "SELECT * FROM user WHERE id=$_SESSION[userId]";
$requestA = mysqli_query($mysqli, $queryA);
echo $content;
?>
<?php
$mysqli = mysqli_connect("localhost", "root", "", "crm");
//mysqli_query($mysqli, "SET NAMES 'utf8'");
session_start();
?>
<?php
ob_start();
register_shutdown_function("show_template");
function show_template() {
$content = ob_get_clean();
include __DIR__ . "\panel.php";
}
?>
<?php
require_once "db.php";
require_once "initial.php";
?>
<?php
require_once "db.php";
if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) {
$user = mysqli_real_escape_string($mysqli, $_REQUEST['user']);
$pass = mysqli_real_escape_string($mysqli, $_REQUEST['pass']);
$query = "SELECT * FROM user WHERE username='$user' AND password='$pass'";
$result = mysqli_query($mysqli, $query);
if (mysqli_num_rows($result) == 1) {
$userID = mysqli_fetch_assoc($result);
$_SESSION['userId'] = $userID['id'];
header("location: /crm/home.php");
exit;
}else{`enter code here`
echo 'error';
}
}
?>
我的文件中有些代码有错误 而且我不知道我在做什么。 这是一个带有模板代码的网站