i have one page with a navbar button on top. Also, i use one sonoff wifi switch to power on/off one lamp.
I am trying to make this task order to work.
- User press on navbar the button.
- Load power_off.php, which is the code below.
- After 2seconds redirect to google page.
Code power_off.php
<?php
session_start();
unset($_SESSION['valid']);
unset($_SESSION['timeout']);
header( "url=http://192.168.2.2/cs?cmnd=Power%20Off" );
header( "refresh:2;url=http://www.google.gr/" );
?>
Thank you.