sandy1028 Posted October 23, 2007 Share Posted October 23, 2007 hi, I am facing problem in refreshing... When any new data is added in database it is not displayed unless the page is refreshed with F5 key How can I make the page auto refresh when the data is added Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/ Share on other sites More sharing options...
sandy1028 Posted October 25, 2007 Author Share Posted October 25, 2007 hi, Please help me with this Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/#findComment-377706 Share on other sites More sharing options...
rajivgonsalves Posted October 25, 2007 Share Posted October 25, 2007 You could use Ajax and check the database every 1 minutes or so here a link which might help http://en.wikipedia.org/wiki/Ajax_(programming) or if you do not want to check if data has change you can refresh the page with a meta tag <meta http-equiv="refresh" content="60" /> 10 - number of seconds Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/#findComment-377717 Share on other sites More sharing options...
sandy1028 Posted October 30, 2007 Author Share Posted October 30, 2007 If I use meta tag the page gets refresh and page gets disturbed when viewing the page Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/#findComment-380923 Share on other sites More sharing options...
trav Posted October 30, 2007 Share Posted October 30, 2007 i would use ajax here is a quick fast tutorial http://w3schools.com/ajax/default.asp you don't even really need to know javascript, just take the section of your code that displays the dynamic data and move it into another .php file, then use ajax to grab it, then you can make a button or link that refreshes the data, or a timer, or set a function that checks at intervals for the number of result to have changed from the number display and at that point display a button to refresh or some other notification so the user can be in control of when to refresh, hope that helped. Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/#findComment-380942 Share on other sites More sharing options...
trav Posted October 30, 2007 Share Posted October 30, 2007 here is another tutorial aimed more at php integration http://www.w3schools.com/php/php_ajax_intro.asp also one last thought, you should have a catch so that if a person's website doesn't support ajax it will display normally with a note that the information will not be refreshed (or use a meta tag) Quote Link to comment https://forums.phpfreaks.com/topic/74413-auto-refresh/#findComment-380943 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.