I'm trying to make a chatroom and the username should be the same as the username you use when you log into my website which i store in a variable, I use the exact same code and that works but when i write this:
function do_send(){
name=<?php echo $_SESSION['uid']; ?>;
note=$("#note").val();
it doesn't work, nothing shows up, the weird thing is when i change 'uid' to 'id' it works, but the id is just a number you get when signing up so nothing useful.
It worked for me when i wanted a message to show up that you were logged in to the website and the username should show up which is almost the same code echo $_SESSION['uid']
Sorry if this is quite messy, never uploaded something here before so i'm not familiar with the options/settings.