[英]Access denied www-data@localhost
我正在使用Jquery.load
將具有html / php內容的外部文件加載到一個div中。 它會加載文件,並顯示其應有的內容,只說access denied www-data@localhost password: no
應該在其中回顯某些內容。
我知道主頁,而不是正在加載的頁面,是使用require_once("assets/functions/config.php");
連接到數據庫的require_once("assets/functions/config.php");
調用包含連接的我的php文件。
我究竟做錯了什么? 這可能很簡單,而我卻忽略了一些東西。
編輯:好的,在<html>
以上的index.php上,我有:
<?PHP
require_once("assets/functions/config.php");
//if ($notInstalled == 1) header("Location: install");
require_once("assets/functions/functions.php");
if ($users->checkAuth() == 0) {
header("Location: login.php");
exit;
}
$currentUser = $_COOKIE['vetelixir_username'];
?>
config.php如下:
<?
// MySQL Database
$db_host = "localhost";
$db_name = "dbname";
$db_username = "username";
$db_password = "password";
// Connect to the database
$connection = @mysql_connect($db_host,$db_username,$db_password) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
// end MySQL
?>
jQuery的:
$("#button").click(function() {
$('#content').load('pages/external.php');
});
外部文件加載:
<div id="div">
<?
$currentBlah = mysql_query("SELECT `firstname`,`lastname` FROM `blah` ORDER BY `lastname` ASC") or die(mysql_error());
while($u = mysql_fetch_array($currentBlah)) {
echo "<div class='clientRow'><span class='name'>".$u['firstname']." ".$u['lastname']."</span></div>";
}
?>
</div>
看起來您的jQuery函數正在調用的php腳本正在嘗試(但失敗)打開SSH會話。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.