Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en" class="no-js">
  3. <head>
  4. <title>just for test</title>
  5. </head>
  6. <div id="Response" ></div>
  7. <h3>login</h3>
  8. <form id="Login" class="form-login">
  9. <input type="text" class="form-control" name="yourname" id="yourname" placeholder="yourname">
  10. <button type="submit" class="btn btn-bricky pull-left"> ورود <i class="fa fa-arrow-circle-right"></i> </button>
  11. </form>
  12. </div>
  13. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  14. <script>
  15. $(document).ready(function (e){
  16. $("#Login").on('submit',(function(e){
  17. e.preventDefault();
  18. $.ajax({
  19. url: "include/php/check_login.php",
  20. type: "POST",
  21. data: new FormData(this),
  22. contentType: false,
  23. cache: false,
  24. processData:false,
  25. success: function(data)
  26. {
  27. if(data=='faile'){
  28. $("#Response").html('you had wrong...');
  29. }else{
  30. $("#Response").html(data);
  31. }
  32. return false;
  33. }
  34. });
  35. }));
  36. });
  37. </script>
  38. </body><!-- end: BODY -->
  39. </html>
  40.  
  41. <?php
  42. session_start();
  43. if (isset($_POST['yourname']) && !empty($_POST['yourname']))
  44. {
  45. $yourname=$_POST['yourname'];
  46. echo $yourname;
  47. }
  48. else echo "faile";
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement