问候我目前第一次尝试为我的网站开发登录。对于这个登录,我使用 PHP 和 MySQL。我的问题是我不断收到下面的错误......我已经尝试用尽所有可能性来重命名我所知道的“require_once”输入,但仍然知道运气。
Warning: require_once(C:\Users\Derek\Fall_2013\PS-WebDesign\includes\constants.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\11311638\html\classes\Mysql.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'C:\Users\Derek\Fall_2013\PS-WebDesign\includes\constants.php' (include_path='.;C:\php\pear') in D:\Hosting\11311638\html\classes\Mysql.php on line 3
下面是产生致命错误的代码行,我的问题是我没有正确调用该文件还是缺少我虚弱的头脑的代码?错误在第 3 行“require_once ....”
<?php
require_once 'includes/constants.php';
class Mysql {
private $conn;
function __construct() {
$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die(
'You ***'d up.');
}
function verify_Username_and_Pass($un, $pwd) {
$query = "SELECT *
FROM users
WHERE username = ? AND password = ?
LIMIT 1";
if($stmt = $this->conn->prepare($query)) {
$stmt->bind_param('ss', $un, $pwd);
$stmt->execute();
if($stmt->fetch()) {
$stmt->close();
return true;
}
}
}
}