Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // establishing the mysqli connection
- $con = mysqli_connect("localhost","root","","USERS");
- if(mysqli_connect_error())
- {
- echo "My SQLi Connection was not established:".mysqli_connect();
- }
- //checking the user
- if(isset($_POST['login'])){
- $Password = mysqli_real_escape_string($con,$_POST['Password']);
- $sel_userName= "sel*from users where userName='userName AND Password='$Password'";
- $run_userName = mysqli_query($con,$sel_userName);
- $check_userName = mysqli_num_rows($run_userName);
- if(check_userName>o){
- $_SESSION['userName']=$userName
- echo "<script>window.open(‘NEW.php’,’_self’)</script>";
- }
- else{
- echo"<script>alert('Username or password is incorrect,try again!’)</script>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement