Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * Tecflare Corporation
  5. * Copyright Tecflare Corporation
  6. * Provided by the Tecflare Corporation System
  7. * * Code has been scanned by styleci.io
  8. */
  9.  
  10. $host = $_POST['hostname'];
  11. $username = $_POST['username'];
  12. $password = $_POST['password'];
  13. $database = $_POST['database'];
  14. //Verify Connection
  15. $link = mysqli_connect($host, $username, $password, $database);
  16. /* check connection */
  17. if (mysqli_connect_errno()) {
  18. header('Location: index.php?error');
  19. die();
  20. }
  21. /* check if server is alive */
  22. if (!mysqli_ping($link)) {
  23. header('Location: index.php?error');
  24. die();
  25. }
  26. $conn = new mysqli($hostname, $username, $password, $database);
  27. $sql = 'CREATE TABLE Administrators (
  28. id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  29. username VARCHAR(1000),
  30. password VARCHAR(1000)
  31. )';
  32. $conn->query($sql);
  33. $sql = 'CREATE TABLE Settings (
  34. id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  35. code VARCHAR(1000),
  36. value VARCHAR(1000)
  37. )';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement