Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['btnsubmit']))
- {
- if($_POST['username'] == "test" . "admin")
- {
- echo "username correct!<br/>";
- $user = true;
- }
- else
- {
- echo "username wrong!<br/>";
- $user = FALSE;
- }
- if($_POST['password'] == "test" . "admin")
- {
- echo "password correct!<br/>";
- $pass = true;
- }
- else
- {
- echo "password failed!<br/>";
- $pass = FALSE;
- }
- if($user == TRUE && $pass == TRUE)
- {
- echo "Login succeded!";
- echo "<meta HTTP-EQUIV='REFRESH' content='5; url= www.google.com'>";
- }
- else
- {
- echo "Login failed";
- echo '<script type="text/javascript">'
- , 'history.go(-1);'
- , '</script>'
- ;
- }
- }
- ?>
- $users = Array("admin" => "admin", "test" => "test");
- if(isset($users[$_POST['username']]))
- ...
- if($users[$_POST['username']] == $_POST['password'])
- echo '<script type="text/javascript">'
- , 'history.go(-1);'
- , '</script>'
- ;
- echo '<script type="text/javascript">'
- . 'history.go(-1);'
- . '</script>'
- ;
- if($user == TRUE && $pass == TRUE)
- {
- echo "Login succeded!";
- echo "<meta HTTP-EQUIV='REFRESH' content='5; url= https://www.google.com'>";
- }
Add Comment
Please, Sign In to add comment