hi im creating a chat project in php! ive created a database that is used to authorize loggin! im having problem with the chat page itself. on the page therz a textarea and a form and submit button! im confused! i dont know whether to use a txt file to open save update the message or to use mysql! plz help and plz tell me how to automatically refresh page in php! tkx
If I were you I would go for mysql instead of a textfile, both options are possible and mostly a matter of taste. The advantage of mysql is that you can easily request the last 10 or more results (you don't want to display all the conversation every time).
For refreshing you could go with a meta refresh, which is annoying cause if I'm typing something and it meta refreshes, it's gone (atleast, I think. You could test it). You could use an button to let the user manually refresh it when he/she is ready. Still not a very desirable situation.
Keep in mind that you will have to let users time out, some users won't press your fancy logout button.
Good luck with your project.
tkx for the advise! i seek advice on ajax then! thank you a lot!
I was wondering if you could do an iframe that will refresh and use css to position it where the you want the conversation to go. Most browsers handle iframes ok but I think that could still become an issue. I don't know if the iframe would be able to inherit the login credentials securely.
Well, I am barely learning php myself so I dont know if it would use the same session.
It works for me, maybe it will work for you?