Hi, Basically what happens at the moment is when a user wants to log into the chat room they have to input their username into a form input box and click the sign in (as below) <input type="text" name="username" id="username" /> <a href="#" onClick="login();">Enter the chat room »</a> Code (markup): However i want them to be signed in on body load with the username being $username, i'm not too knowledgable with javascript so i'm a tad lost. Thanks in advance for your help
Hi I'm not to sure what your asking .. do you want the field to be pre-populated with the value of $username?
Ok, At the moment users have to enter what they want as a username and click the link to sign in, what i want is that users are automatically signed in as the page loads with the username thats set in php, $username
Ok, I'm lost but assuming the username is set before the page in question is loaded. When that page loads move the login() to the body onload function. body onload="login()" , which means the JS has to be in the head of the page. And you have to set the username using PHP to write out a form field for it.