Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en" class="no-js">
- <head>
- <title>just for test</title>
- </head>
- <div id="Response" ></div>
- <h3>login</h3>
- <form id="Login" class="form-login">
- <input type="text" class="form-control" name="yourname" id="yourname" placeholder="yourname">
- <button type="submit" class="btn btn-bricky pull-left"> ورود <i class="fa fa-arrow-circle-right"></i> </button>
- </form>
- </div>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
- <script>
- $(document).ready(function (e){
- $("#Login").on('submit',(function(e){
- e.preventDefault();
- $.ajax({
- url: "include/php/check_login.php",
- type: "POST",
- data: new FormData(this),
- contentType: false,
- cache: false,
- processData:false,
- success: function(data)
- {
- if(data=='faile'){
- $("#Response").html('you had wrong...');
- }else{
- $("#Response").html(data);
- }
- return false;
- }
- });
- }));
- });
- </script>
- </body><!-- end: BODY -->
- </html>
- <?php
- session_start();
- if (isset($_POST['yourname']) && !empty($_POST['yourname']))
- {
- $yourname=$_POST['yourname'];
- echo $yourname;
- }
- else echo "faile";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement