PHP progress bar production
﹋南初°
﹋南初° 2018-04-23 12:13:48
0
2
1263

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_11.png0

//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;

?>

Dynamicly display the progress bar of the server running program

;

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 )

{

}

?>

flush(); //Send the output to the client browser so that It can immediately execute JavaScript programs output by the server.

$progress = $pix;

} //end foreach

?>

flush();

?>


﹋南初°
﹋南初°

好好学PHP。

reply all (2)
豆本熊

Why can’t we put the p tag in the p tag? It can put any tag

    猪哥

    Tags can be nested infinitely

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!