Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script>
- function fnajax()
- {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function()
- {
- if (xhttp.readyState == 4 && xhttp.status == 200)
- {
- document.getElementById("demo").innerHTML = xhttp.responseText;
- }
- };
- var username=document.getElementById("username").value;
- var password=document.getElementById("password").value;
- xhttp.open("GET", "ajaxworker.php?username="+username+'&password='+password, true);
- xhttp.send();
- }
- </script>
- </script>
- </head>
- <body>
- <form id="frm1" action="process.php" method="post">
- <input type="text" id="username" name="username" placeholder="User Name" />
- <input type="password" id="password" name="password" placeholder="Password" />
- <input type="button" onclick="fnajax()" value="submit"/>
- <!--<input type="submit" /> -->
- <div id="demo"></div>
- </form>
- </body>
- </html>
- <?php
- echo "hey " .$_GET['username']."!, your password was ".$_GET['password'];
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement