Sorry, feeling a bit tired, which is why I make less sense.
echo "var userN2 = '" . echo getRank($user); . "'; \n";
echo "chat_div.innerHTML += userN2;\n";
userN2 is declared,
var userN2 = user_node[0].firstChild.nodeValue;
I need Javascript to give the PHP variable ($user) a username to get the user's rank, I can give Javascript a variable from PHP, however, when someone types in the chatbox, it would read their user level, therefore making everyone else have the same rank.
Still trying to make as much sense as I can, and again, I appreciate the help.
var user_node = message_nodes[i].getElementsByTagName("user");
var text_node = message_nodes[i].getElementsByTagName("text");
var time_node = message_nodes[i].getElementsByTagName("time");
var userN2 = user_node[0].firstChild.nodeValue;
That's all that's declared in the function, I know I don't have to have userN2 declared, I only declared it, for testing purposes, makes it easier / faster to type.