B16MCC
03-07-2012, 01:56 PM
Hi guys, I'm looking to build a widget either HTML or PHP to display progress.
Let's say I set a target of ?1000. Perhaps I add this to the database or more simply just use a text file on my server. I read the single line of text from the text file which is my current value. I want to display that value as a progress bar.
For example,
progress bar min value = 0
progress bar max value = 1000
Read value from file, EG, 125
Show this value on the progress bar.
Secondly, I want a button that opens an input box where I enter a value, and it adds that value to the value stored in the text file then updates the progress bar.
I've got some PHP code for reading and writing to a text file , but I've not idea where to start with a progress bar and input box.
Here's what I've got so far, simply displaying the value from the file.
$file = "martin_fund.txt";
$f = fopen($file, "r");
while ( $line = fgets($f, 4) ) {
$output = '?' . $line;
}
Any help would be greatly appreciated.
Thanks
B.
Let's say I set a target of ?1000. Perhaps I add this to the database or more simply just use a text file on my server. I read the single line of text from the text file which is my current value. I want to display that value as a progress bar.
For example,
progress bar min value = 0
progress bar max value = 1000
Read value from file, EG, 125
Show this value on the progress bar.
Secondly, I want a button that opens an input box where I enter a value, and it adds that value to the value stored in the text file then updates the progress bar.
I've got some PHP code for reading and writing to a text file , but I've not idea where to start with a progress bar and input box.
Here's what I've got so far, simply displaying the value from the file.
$file = "martin_fund.txt";
$f = fopen($file, "r");
while ( $line = fgets($f, 4) ) {
$output = '?' . $line;
}
Any help would be greatly appreciated.
Thanks
B.