Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is the front end
- <section id="MiddlePart">
- <form >
- <b id="Login1"> Name </b>
- <input id="Login1" type="text" name="txtName" value="" /></br>
- <b id="Login2"> Password </b>
- <input id="Login2" type="password" name="txtPassword" value="" />
- <input id="btnLogin" type="button" value="Login" />
- </form>
- <?php
- if (isset($_GET['btnLogin'])) {
- $formUsername = $_GET['txtName'];
- $formPassword = $_GET['txtPassword'];
- $connObj->LoginValidation($formUsername, $formPassword);
- if ($connObj->LoginValidation($formUsername, $formPassword)) {
- header('location:AdminPage.php');
- }
- }
- ?>
- </section>
- This is the function im recalling
- function LoginValidation($user, $pass) {
- $query = "SELECT * FROM `logintable` WHERE `username` ='$user' AND `password` = '$pass' ";
- $result = mysqli_query($this->link, $query);
- $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
- if (count($row) ==0)
- {
- return FALSE;
- }
- else {
- return TRUE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement