Simple chat facility - if file exists not working |
We are trying to build a simple chat facility without using a database & have got the basic facility to work between 2 uses.
However, we want to first search to see if there is already a previous chat session in existence, but cant get that to work. This is what we have tried; PHP Code: <?php If the file does not exist then the Controller Files & View Files are created. That part works OK but needs further work. Can anybody guide us as to what we are doing wrong? UPDATE Ive got the system working but I need to learn how to get the scroll bar at the bottom. I want to get the scroll bar at the bottom when the page is opened, instead of the top by default. From my research CSS does not facilitate that. The following is my current coding; PHP Code: <style type="text/css"> .mem { position: fixed; width: 53%; left: 46%; top: 30%; font-family: arial; font-size: 100%; color: Black; bottom: 3.7%; overflow: auto; } </style> I would like a simple instruction like in the following, but that does not work; PHP Code: <style type="text/css"> .mem { position: fixed; width: 53%; left: 46%; top: 30%; font-family: arial; font-size: 100%; color: Black; bottom: 3.7%; overflow: auto; scrollToBottom; } </style> From my research it is only achievable by Javascript. Ive searched the following & acquired the coding below but they dont work; https://stackoverflow.com/questions/1861...scrolls-up PHP Code: var element = document.getElementById("yourDivID"); https://stackoverflow.com/questions/7063...-to-bottom The Javascript code below should keep your div's scrollbar positioned at the bottom like you described: PHP Code: var objDiv = document.getElementById("divExample"); |
Welcome Guest, Not a member yet? Register Sign In |