Guest User

Untitled

a guest
Jan 17th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. <?php include ("php/head.php"); ?>
  2. <div id="wrapper">
  3.  
  4. <div id="container">
  5.  
  6. <div id="intro">
  7.  
  8. <h2><center>Are you a member? Login ...</center></h2>
  9. <h3><center>And enjoy hundreds of services.</center></h3>
  10.  
  11.  
  12.  
  13. <div id="log_form">
  14.  
  15. <form action="php/login.php" method="post" class="login_form">
  16.  
  17. <input type="text" size="25" name="log_uname"
  18. id="login_txt" placeholder="Your Username">
  19. <input type="password" size="25" name="log_password" id="login_pass" placeholder="Your Password">
  20. <label id="check"><input type="checkbox" name="checkbox"> Remember Me</label>
  21. <input type="submit" name="submit1" id="login_sub" value="LogIn">
  22. <img id="loading1" src="images/ajax-loader.gif" alt="working.." />
  23.  
  24.  
  25.  
  26. <script>
  27. $('#login_txt').click(function (e) {
  28. e.preventDefault();
  29. $('#error1').fadeOut('fast', function () {
  30. $(this).css("visibility","hidden");
  31. });
  32. });
  33. </script>
  34.  
  35. </form>
  36.  
  37. <div id="error1"></div>
  38. </div>
  39.  
  40. <div id="new_users">
  41. <h4 class="h4_users">New Users ...</h4>
  42.  
  43. <a href="#"><img src="#" width="55" height="55"></a>
  44. <a href="#"><img src="#" width="55" height="55"></a>
  45. <a href="#"><img src="#" width="55" height="55"></a>
  46. <a href="#"><img src="#" width="55" height="55"></a>
  47. </div>
  48.  
  49. </div>
  50.  
  51. <div id="register">
  52. <h2><center>Sign up Below ...</center></h2>
  53. <h3><center>Easy, fast and free!</center></h3>
  54.  
  55. <form action="php/register.php" method="post" name="form" class="form">
  56. <input type="text" size="25" name="fname" placeholder="First Name">
  57. <input type="text" size="25" name="lname" placeholder="Last Name">
  58. <input type="text" size="25" name="username" placeholder="Username">
  59. <input type="text" size="25" name="email" placeholder="Email">
  60. <input type="text" size="25" name="email2" placeholder="Repeat Email">
  61. <input type="password" size="25" name="password" placeholder="Password">
  62. <input type="password" size="25" name="password2" placeholder="Repeat Password">
  63. <input type="submit" name="submit" id="sub" value="Sign Up!">
  64. <img id="loading" src="images/ajax-loader.gif" alt="working.." />
  65. </form>
  66. <div id="error"></div>
  67. </div>
  68. </div>
  69.  
  70. <?php include("php/footer.php"); ?>
  71.  
  72. $(document).ready(function(){
  73.  
  74. $('.form').submit(function(e) {
  75. register();
  76. e.preventDefault();
  77. });
  78.  
  79. $('.login_form').submit(function(e) {
  80. login();
  81. e.preventDefault();
  82. });
  83.  
  84. });
  85.  
  86. function register(){
  87. hideshow('loading',1);
  88. error(0);
  89.  
  90. $.ajax({
  91. type: "POST",
  92. url: "php/register.php",
  93. data: $('.form').serialize(),
  94. dataType: "json",
  95. success: function(msg){
  96. if(parseInt(msg.status)==1){
  97. window.location=msg.txt;
  98. } else if(parseInt(msg.status)==0) {
  99. error(1,msg.txt);
  100. }
  101. hideshow('loading',0);
  102. }
  103. });
  104. }
  105.  
  106. function login(){
  107. hideshow1('loading1',1);
  108. error1(0);
  109.  
  110. $.ajax({
  111. type: "POST",
  112. url: "php/login.php",
  113. data: $('.login_form').serialize(),
  114. dataType: "json",
  115. success: function(msg1){
  116. if(parseInt(msg1.status1)==1){
  117. window.location=msg1.txt1;
  118. } else if (parseInt(msg1.status1) == 0) {
  119. error1(1,msg1.txt1);
  120. }
  121. hideshow1('loading1',0)
  122. }
  123. });
  124. }
  125. function hideshow(el,act){
  126. if(act) $('#'+el).css('visibility','visible');
  127. else $('#'+el).css('visibility','hidden');
  128. }
  129. function error(act,txt){
  130. hideshow('error',act);
  131. if(txt) $('#error').html(txt);
  132. }
  133. function hideshow1(el,act){
  134. if(act) $('#'+el).css('visibility','visible');
  135. else $('#'+el).css('visibility','hidden');
  136. }
  137. function error1(act,txt1){
  138. hideshow1('error1',act);
  139. if(txt1) $('#error1').html(txt1);
  140. }
  141.  
  142. $('#error1').fadeOut('fast', function () {
  143. $(this).show()
  144. $(this).css("visibility","hidden")
  145. })
Add Comment
Please, Sign In to add comment