Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post">
- <input type="text" id="username" placeholder="username" /><br>
- <input type="password" id="password" placeholder="password" /><br>
- <input type="button" id="btn" value="Login" />
- </form>
- <div id="feed_back"></div>
- <script src="https://code.jquery.com/jquery-3.2.1.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#btn').click(function(){
- var username = $('#username').val();
- var password = $('#password').val();
- $.ajax({
- type: 'POST',
- url: 'alma.php',
- data: {username:username, password:password},
- statusCode:{
- 404: function() {
- $('#feed_back').html('A file not found');
- },
- 000: function() {
- $('#feed_back').html('a file not found');
- }
- },
- succes: function(data){
- $('#feed_back').html(data);
- }
- });
- });
- });
- </script>`
- </body>`
- <?php
- $username = $_POST['username'];
- $username = $_POST['password'];
- $username = strrev($username);
- echo $username.' '.$password;
- ?>
Add Comment
Please, Sign In to add comment