I am creating a small chat room using PHP, MySQL & Dreamweaver. Everything is great apart from one problem that I can't seem to find the answer.
The first page of the site is a login screen, which obviously only allows registered users to enter the chat room. A successfull login moves the user to page 2, which is the Chat Room. I would like to now how to;
Display the users name in a header bar in the chatroom, so that I can add a welcome message.
Autocomplete the username field of the database when the users posts a message. This is to save them having to type in their name every time they post.
Also, how do I refresh the page so that if the users doesn't post a message it still updates when other users post theirs.
Any help would be much appreciated.
Thanks
Housey
1) you can display the logged in username using php like this:
<?php echo $_SESSION['MM_Username'];?
You can put this code anywhere you want to show the logged in username.
2)Have a hidden field in the 'post a message' form like this:
<input name="username" type="hidden" value="<?php echo $_SESSION['MM_Username'];?
use this hidden field as the username in the post.
3) The easiset way is like this using the meta tag
<head><meta http-equiv="refresh" content="10"></head>
rockman