Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP/JS/AJAX HELP not refreshing.

I am trying to refresh SQL data that is displayed onto my page. I want it to refresh every second. At the moment, after the balance has been displayed, after the 1 second the data stays but it doesn't update.

I have had to upload the code onto a different site as it won't let me put it here without blocking me and giving a cloudflare error.
CODE:
http://kopy.io/tJvzq#bLEXdZmmwjWOki


I think my problem is that the $_SESSION['Money'] is not being refreshed however, I don't know how to change this as I am only familiar with PHP.

Can someone please be kind enough to help me out with this

Thanks.
(Jun 3, 2016 03:52 PM)TrojaηHorsє Wrote:  I am trying to refresh SQL data that is displayed onto my page. I want it to refresh every second. At the moment, after the balance has been displayed, after the 1 second the data stays but it doesn't update.

I have had to upload the code onto a different site as it won't let me put it here without blocking me and giving a cloudflare error.
CODE:
http://kopy.io/tJvzq#bLEXdZmmwjWOki


I think my problem is that the $_SESSION['Money'] is not being refreshed however, I don't know how to change this as I am only familiar with PHP.

Can someone please be kind enough to help me out with this

Thanks.

You need to use something called AJAX.
http://www.w3schools.com/ajax/ajax_xmlht...t_send.asp

You would need to send a request to the server with each JS call and then update the results on page.
It would look like this:
http://kopy.io/6EBmj
I added the getAjax GET variable, just so you dont get "whole" page each time, but rather get just the money number with ajax call.
(Jun 4, 2016 01:04 AM)Shroomies_temp Wrote:  You need to use something called AJAX.
http://www.w3schools.com/ajax/ajax_xmlht...t_send.asp

You would need to send a request to the server with each JS call and then update the results on page.
It would look like this:
http://kopy.io/6EBmj
I added the getAjax GET variable, just so you dont get "whole" page each time, but rather get just the money number with ajax call.

Hey,

thanks for the answer mate, it works now but I've somehow managed to make it work without needing ajax which is weird because even i was sure i needed to use ajax haha.

TH.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by FaberCastellFeb 28, 2018 08:51 AM 3 135 Feb 28, 2018 08:51 AM
Last Post: VouchPotato™
by dearucheAug 30, 2017 11:54 AM 1 122 Aug 30, 2017 11:54 AM
Last Post: Nachfolger
by Versatile.Aug 27, 2017 07:06 PM 0 120 Aug 27, 2017 07:06 PM
Last Post: Versatile.