html - Reload Page on after some php code -


I am displaying a log file from my Raspberry P (door lock / door opened).
I have the possibility to delete this logfile with a button.
and click on the same button to reload the page and display the empty logfile.

I have the code:

  & lt; Form method = "get" action = "test.php" & gt; & Lt; Input type = "submit" value "test" name = "test1" & gt; & Lt; / Form & gt; & Lt ;? Php if (isset ($ _GET ['test1'])) {unlink ('test.txt'); Touch ('test.txt'); }? & Gt;   

This code reloads the page but does not display the empty log file (but it deletes the logfile and creates a new blank one).
What do I want now that the page should be reloaded after the PHP code, so the empty logfile is displayed immediately. I do not know at all what can I do? Any signals?

  & lt ;? Php if (isset $ _GET ['test1'])) {unlink ('test.txt'); Touch ('text.txt'); Header ("Location:". $ _SERVER ['PHP_SELF']); Go out(); }? & Gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -