Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class login {
- private $user = "user";
- private $pass = "pass";
- function checkLogin() {
- if($this->user == $_POST['email'] && $this->pass == $_POST['password'])
- {
- echo"success!";
- } else {
- echo"Invalid email or password.";
- }
- }
- }
- if(isset($_POST['submit']))
- {
- $login = new login();
- $login->checkLogin();
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="email"/>
- <br/>
- <input type="password" name="password" />
- <br/>
- <input type="submit" name="submit" value="Log In" />
- </form>
Add Comment
Please, Sign In to add comment