I have this simple code and I want it running all the time on the server,AND NOT ONLY WHEN IT IS OPENED IN BROWSER TAB.
I dont know exactly what is happening in http header but i guess that there is a way to keep it running non stop.
Is there some header() directive?
<?php
session_start();
$i=0;
if(!empty($_SESSION["i"]))
{
$i=$_SESSION["i"];
}
if($i==1)
{
rename("php.gif","pom.gif");
rename("logo.gif","php.gif");
rename("pom.gif","logo.gif");
$_SESSION["i"]=0;
print("txt1 u txt2");
header('Refresh: 5');
}
if($i==0)
{
rename("logo.gif","pom.gif");
rename("php.gif","logo.gif");
rename("pom.gif","php.gif");
$_SESSION["i"]=1;
print("txt2 u txt1");
header('Refresh: 5');
}
?>