Guest User

Untitled

a guest
Oct 9th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function enable_code($mac,$access_code,$code)
  2. {
  3.  
  4. $host = 'localhost';
  5. $database = 'xxxxx';
  6. $user = 'xxxx';
  7. $pass = 'xxxx';
  8.  
  9. $link = mysqli_connect($host,$user,$pass,$database);
  10. if(!$link){die("Database connection failde: ".mysqli_error());}
  11. $dbselect = mysqli_select_db($link,$database);
  12. if(!$dbselect){die("Database selection failed: ".mysqli_error($link));};
  13.  
  14. if ($access_code == $code)
  15. {
  16.  
  17. shell_exec("iptables -t mangle -I internet 1 -m mac --mac-source ".$mac." -j ACCEPT");
  18.  
  19.  
  20. mysqli_query($link,"UPDATE dataconnection SET enable = 1 WHERE mac = '$mac'");
  21. sleep(1);
  22. header("location:http://".$_GET['add']);
  23. exit;
  24.  
  25. }
Add Comment
Please, Sign In to add comment