How do i code this in PHP?

timbruningtwine

New member
I need a progress bar in PHP but i dont need it to move or anything, all i need it to be is a black box, say 100px long and if i edit the script somewhere i can enter a number between 1 and 100 and if i enter 1 it draws a blue bar inside the black box exacly 1px wide if i enter 97 into the scipt it draws a black box with a blue bar inside that is 97px long.

So basically a progress bar that shows the progress i set it to.
 
I'd do it with a table, containing a single cell. Assuming you pass a POST variable named size:

<?php
if(isset($_POST['size'])) {
echo "<table cellspacing=\"0\">\n";
echo "<tr><td style=\"width: $_POST[size]px; height; 1px; background: 1px solid #000;\"></td></tr>\n";
echo "</table>\n";
}
?>
 
Back
Top