Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('connection.php');
- $ic=$_POST['icNum'];
- $pwd =$_POST['password'];
- $login=mysqli_query($conn, "SELECT * FROM user WHERE
- icNum='$ic' and password= '$pwd' ");
- if(mysqli_num_rows($login)>0) {
- session_start();
- $_SESSION['icNum'] = $ic;
- session_write_close();
- echo '<script languages="javascript">' ;
- echo 'alert("Login Success");';
- echo 'window.location.href="home.php";';
- echo '</script>';
- }else {
- echo '<script languages="javascript">' ;
- echo 'alert("Login error");';
- echo 'window.location.href="index.php";';
- echo '</script>';
- }
- mysqli_close($conn);
- //create connection to php=$
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement