Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Vinyl Records Lda.</title>
- </head>
- <body>
- <h1>Admin</h1>
- <div class="sign">
- <div class="admin">
- <form method="get" action="login_admin.php">
- <input type="text" name="email" placeholder="email">
- <input type="text" name="password" placeholder="password">
- <button type="submit" value="submit" class="submit">Submit</button>
- </form>
- </div>
- </div>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
- <script src="java.js"></script>
- </body>
- </html>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "pros_si";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if(isset($_GET['email']) and isset($_GET['password'])) {
- $mail = $_GET['email'];
- $pass = $_GET['password'];
- $admin = "INSERT INTO users (username, email, password, client_type, client_saldo)
- VALUES ('null - is an admin' , '$mail' , '$pass' , '0', 'null')";
- if ($conn->query($admin) === TRUE) {
- echo "New record created successfully";
- header( "Location: homepage_admin.php");
- } else {
- echo 'Record null. Try Again';
- }
- }
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- } else {
- echo "Connection successful";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement