0

I have an AJAX chat that I am trying to edit. Originally, the users are stored in a php file. I'm trying to make it get users from a database.

Here's the original users.php file: http://pastebin.com/mgbQjHyK
Here's what I've tried: http://pastebin.com/kXgVLuyG

Can someone tell me what I'm doing wrong?
[hr]
Here's the error that it outputs:

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
[theres nothing displayed after this]

3
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by Danny247
0

$users[$uid]['userName'] = '$username'; should be: $users[$uid]['userName'] = $username; No apostrophes around $username . Other than that, make sure that the AJAX_CHAT_XXX CONSTANTS you are using are defined.

0

Thanks and I fixed it, still have error though D:

The constants are correct.

0

are you including multiple files? If so, then check in the other files. After the corrections above, the file you posted should not be giving you any problems.

Also, check your error log file. If you are with a web host, ask them for the location of your log file.

0

one more suggestion - change:

$con = mysql_connect("localhost", "dannyf_admin", "mypasswordishere");
mysql_select_db("dannyf_test", $con);
$query = mysql_query("SELECT * FROM ajax_chat_users");
 
while($row = mysql_fetch_array($query)){

to:

$con = mysql_connect("localhost", "dannyf_admin", "mypasswordishere") or die(mysql_error());
mysql_select_db("dannyf_test", $con) or die(mysql_error());
$query = mysql_query("SELECT * FROM ajax_chat_users") or die(mysql_error());
 
while($row = mysql_fetch_assoc($query)){
0

I fixed all that, and I still have the problem.

If it helps find me a solution, this is the script I am using: https://blueimp.net/ajax/

Thanks in advance for a good solution (and thanks to everyone who has replied so far :)).

0

use parse functions to changing the type of file system i am also develop project using scripting language. so you will get some idea from by give below website:
<URL SNIPPED>

Edited by peter_budo: Keep It Spam-Free - Do not mention, plug or refer to any product, service, or website you are affiliated with

0

error on line 2 at column 1

that doesn't tell on which file. The fact that I don't see the constants defined on the file you posted indicates that there are file being included in the "main" file. Thus, you need to find out which file is the one that actually has the problem. Look at your php log file as indicated previously.

0

I will check the log file and see if anything is there. The error I get isn't your typical PHP/apache error message, this looks like it was outputted by something the creator of the script made.

Edit: nothing in the error log file from cPanel...

Edited by Danny247: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.