Can anyone of you tell me why this doesn't work?
When i open the file doesnt run anything :(
This is my php file:
<!DOCTYPE html>
<html>
<head>
<title>Restarter V1.0</title>
<meta charset="UTF-8">
</head>
<body>
<?php
#Function Declaration
function testpy() {
exec("sudo python /var/www/html/reboot.py"); #just executes "reboot now"
}
#Get 'gotbut'
if (isset($_GET['gotbut'])) {
testpy();
}
?>
<script>
window.close(); <!--When i open it from my index.php-->
</script>
</body>
</html>
I have also added a line in my "/etc/sudoers" file with the following:
www-data ALL=(ALL) NOPASSWD: ALL
Please help :D
Thanks!
/var/log/apache2/error.log
[Thu Oct 20 09:27:45.015801 2016] [:error] [pid 743] [client 192.168.0.19:55998] PHP Notice: Undefined index: closetab in /var/www/html/index.php on line 21, referer: http://192.168.0.13/?closetab=1