Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess denied www-data@localhost
    primarykey
    data
    text
    <p>I am using <code>Jquery.load</code> to load an external file with html/php content into one div. It loads the file, and displays what it's supposed to except it says <code>access denied www-data@localhost password: no</code> where it should be echoing some content.</p> <p>I know that the main page, not the one being loaded, is connected to the db using <code>require_once("assets/functions/config.php");</code> to call on my php file that contains the connection.</p> <p>What am I doing wrong? It's probably simple, and I'm overlooking something.</p> <p>EDIT: Okay on the index.php above <code>&lt;html&gt;</code> I have:</p> <pre><code> &lt;?PHP require_once("assets/functions/config.php"); //if ($notInstalled == 1) header("Location: install"); require_once("assets/functions/functions.php"); if ($users-&gt;checkAuth() == 0) { header("Location: login.php"); exit; } $currentUser = $_COOKIE['vetelixir_username']; ?&gt; </code></pre> <p>config.php is as follows:</p> <pre><code>&lt;? // 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 ?&gt; </code></pre> <p>jQuery:</p> <pre><code>$("#button").click(function() { $('#content').load('pages/external.php'); }); </code></pre> <p>External File to Load:</p> <pre><code>&lt;div id="div"&gt; &lt;? $currentBlah = mysql_query("SELECT `firstname`,`lastname` FROM `blah` ORDER BY `lastname` ASC") or die(mysql_error()); while($u = mysql_fetch_array($currentBlah)) { echo "&lt;div class='clientRow'&gt;&lt;span class='name'&gt;".$u['firstname']." ".$u['lastname']."&lt;/span&gt;&lt;/div&gt;"; } ?&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload