Im trying to find a way of refreshing a PHP variable on a webpage without reloading the entire page again, I just want the echoed variable to update at a set rate. Any help would be appretiated.
echo "Speed: " . ($APIkbpersec) . " KB/s";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would need to have that function in a seperate file and use an AJAX request to update it.
The standard is jQuery so I will show a very basic example of usage.
http://jquery.com/
This will request the php script and place the contents into the div named “Update”.
To get it updating regulaly you need to have a timer set up:
A page refresh or calling clearInterval() will stop it from running.