Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Test</test>
- </head>
- <body>
- <?php
- $DatabaseName = "******";
- $ServerIP = "******";
- $UsernameDB = "*******";
- $PasswordDB = "*********";
- $Connection = new mysqi($ServerIP, $UsernameDB, $PasswordDB, $DatabaseName);
- if($Connection->connect_error)
- {
- die("Connection failed: ". $Connection->connect_erro);
- }
- echo"Connected successfully";
- if(isset($_POST["submit"]))
- {
- if(isset($_POST["Username"]) && isset($_POST["Password"]))
- {
- $UN = $_POST['Username'];
- $PW = $_POST['Password'];
- $Query = "SELECT * FROM Login WHERE UserName='$UN' AND PassWord='PW'";
- $result = $Connection->$Query;
- $result->num_rows;
- if(num_rows < 0)
- {
- echo"Invalid Creds";
- }
- else
- {
- echo"Welcome";
- }
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment