I obviously copied the code, but the effect is that the style is messed up. I looked at the code and felt there was something wrong. Why can the
tag be placed inside the
tag? I don’t quite understand it, maybe it’s because the more I learn, the more I go back. 0_
0
//Prevent execution timeout
set_time_limit(0);
//Clear and close the output cache
ob_end_clean();
//Data that needs to be cycled
for($i = 0; $i < 188; $i )
{
$users[] = 'Tom_' . $i;
}
//Calculating data Length
$total = count($users);
//The length of the progress bar displayed, unit px
$width = 500;
/ /The unit length of the progress bar occupied by the operation of each record
$pix = $width / $total;
//The percentage of the progress bar that starts by default
$progress = 0;
?>
body,p input {
font-family: Tahoma;
font-size: 9pt
}
;
style=" padding: 0; background-color: #FFCC66; border: 0; width: 0px; text-align: center; height: 16px">
style="position: relative; top: -30px; text-align: center; font-weight: bold; font-size: 8pt">0%
flush(); //Send the output to the client browser
foreach($users as $user)
{
// Use here The empty loop simulates a more time-consuming operation and needs to be replaced in actual applications;
// If your operation is not time-consuming, I think you don’t need to use this script:)
for($i = 0; $i < 100000; $i )
{
}
?>
updateProgress("Operating user ....", );
flush(); //Send the output to the client browser so that It can immediately execute JavaScript programs output by the server.
$progress = $pix;
} //end foreach
?>
//Finally, set the progress bar to the maximum value $width and display that the operation is completed
updateProgress("Operation completed!", );
flush();
?>
Why can’t we put the p tag in the p tag? It can put any tag
Tags can be nested infinitely