Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ارسال بيانات فوم بدون تحديث الصفحة عن طريق اجاكس
- $(document).ready(function(){
- $('#submit').click(function(){
- $.ajax({
- type:'POST',
- url:$('#form').attr('action'),
- data:$('#form').serialize(),
- success:function(dt){
- $('#rez').text('dt');
- }
- });
- });
- });
- <div id='rez'><div/>
- <form action='ajax.php' id='form' method='post'>
- User :
- <input type='text' name='user'/>
- <br />
- Pass :
- <input type='password' name='pass' />
- <br />
- <input type='submit' name='submit' value='Login' id='submit' />
- </form>
- <?php
- $user=$_POST['user'];
- $pass=$_POST['pass'];
- $subm=$_POST['submit'];
- if(isset($subm)){
- if(empty($user) or empty($pass)){
- echo " please check your information and try agian .. ";
- }else{
- echo $user."<br />".$pass;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement