SoFunction
Updated on 2025-04-04

Use php and js to achieve page data refresh

Use the two files "" and "" to achieve data refresh

<head>

<script>
// Refresh code
r_s = 0;
timenow = 0;
function calrs()
{
    d = new Date();
    h= (); m = (); s = ();

    if( m < 10) m = '0' + m;
    if( s < 10) s = '0' + s;
    status = ' ' + h + ":" + m + ":" + s;
    r_s = 2000;
}

calrs();

function reload_me()
{
    c = ("reload1");
    = "";
    = "?reload=1";

    calrs();

    setTimeout('reload_me()', r_s);
}

// Refresh code
setTimeout('reload_me()', r_s);
</script>

<script ></script>

</head><small>
<div Cache-Control: no-cache, must-revalidate");
 echo ".p_show.innerHTML= \"?<font color=red>".rand(0,9)."</font>\"";
?>