shadiadiph Posted May 31, 2009 Share Posted May 31, 2009 mm just a quick question I need some advice on for example I have a main php page and i am using include("head.php"); I want the head.php to refresh which contains my logo css div only without disprupting the rest of the page should i use frames or something else? the reason i want head.php to refresh is to update and clean the database this is a question that i am also about to ask with a chat script I am also writing if i build a php sql chat should I use frames or is there another way to keep an open stream that will update a certain part of the screen without using frames?? I have tried using meta refresh on the included page but it refreshes the entire page not just the included php some advice would be apreciated here thanks Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/ Share on other sites More sharing options...
monkeytooth Posted May 31, 2009 Share Posted May 31, 2009 See this is a bit sticky of an Issue, methods of reload/refresh don't always work pending on user settings, or in some cases pending on the browser type. I would say best way to go with refreshing is javascript (this way you can atleast check to see if its enabled and if its not, then prompt the user to enable it, even if your using the javascript just for a timer to refresh the page). Next thing is, frames though Ideal, aren't really used much anymore, that I have noticed atleast. Most people are jumping on the AJAX train and going that route. Which will cover pretty much all your bases.. AND.. and.. quick google search and you'll find yourself a dozen chat scripts already made that are SQL driven and AJAX ready. Not that I am suggesting go out and use something else, as thats not really the essence of this forum, but none the less its atleast food for thought. Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846164 Share on other sites More sharing options...
shadiadiph Posted May 31, 2009 Author Share Posted May 31, 2009 must say i have gone off of using other peoples pre made scripts so you reckon AJAX is the way to go? I try my hardest to always never use javascript as some people have it disabled as you say frames are hardly used any more i have not used them in the past 4 years can't remember why i stopped but i know there was a good reason?? frames seems to be the only way i can think of doing this but AJAX is a possibility but i know nothing about AJAX and haven;t got a clue on where to start with it?? don't know still undecided any other input would be appreciated. I already made a chat script every aspect of it works individually but when it is put on one page it will not work i guess i may have to use frames with that part. but the thing i am working on now is working out which users are viewing which pages and which are no longer online for eample if the head has not refreshed from a user in the last minute then they cannot be online but i do not want to refresh the whole page in case they have started enterering some data and the page refreshes that would annoy the hell out of them Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846168 Share on other sites More sharing options...
George Botley Posted May 31, 2009 Share Posted May 31, 2009 Heres my 2 cents, put the clear database script into another file and include that file in an iframe with an attribute of refresh_db. In css call the attribute and classify it as "display:none;". That will run your script in the background without it being shown on your page. The full code: <iframe id="refresh_db" src="link to refresh file"></iframe> The CSS #refresh_db { width: 0; height: 0; display: none; } Let me know if that works. A disadvantage to clearing the database in that way is that it may not validate with W3c if your into that validity service like I am as web designer. You could, providing you are using an advance service with Cron Jobs available run a cron at a certain time of day, for example 10:00 in the morning, once a week on a monday. That would then run your clearing script in the background without any access from a user and clear the database automatically. Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846170 Share on other sites More sharing options...
shadiadiph Posted May 31, 2009 Author Share Posted May 31, 2009 I just ran a test on it using display as block so i could see if that page was refreshing and it did i just changed display to none and the page still works so i am assuming it is still working thanks i just tested it refreshing a number increasing it every ten seconds and it worked so in theory it should work with an sql statement i will let you know but i probably won't do that until tomorrow morning i think that is what i was looking for if it validates or not i will let you know Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846186 Share on other sites More sharing options...
George Botley Posted May 31, 2009 Share Posted May 31, 2009 Great News! Whack a script in there and then let me know. Does the iframe actually refresh in display:none; ? In IE or Firefox for example, see if it loads and displays the retreiving data from "page" or has a spinning ajax on the tab bar. That will determine whether it refreshes or not. Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846189 Share on other sites More sharing options...
shadiadiph Posted May 31, 2009 Author Share Posted May 31, 2009 it definately refreshes even in I.E the refresh bar at the bottom keeps appearing seems to work thanks Link to comment https://forums.phpfreaks.com/topic/160349-advice-on-refrshing/#findComment-846196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.