真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

ajax無刷新表單提交

ajax無刷新提交筆記

創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),通河企業(yè)網(wǎng)站建設(shè),通河品牌網(wǎng)站建設(shè),網(wǎng)站定制,通河網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,通河網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競爭力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。

數(shù)據(jù)庫自己模擬建一個 執(zhí)行一下添加功能

php部分采用pdo方法:

'SET NAMES \'UTF8\''); 

$pdo = new PDO($dsn,$user,$pwd,$options);

$name = $_POST['name'];
//print_r ($name);exit;
$pwd  = $_POST['pwd'];
$code  = $_POST['code'];
$sql = "insert into user (name,pwd,code) values ('".$name."','".$pwd."','".$code."')";

$res=$pdo->exec($sql);  

if ($res){
   echo 1;
   exit;
}else{
   echo 2;
   exit;
}

ajax前端部分


        
        $(function(){

            $(".user_main_r button").click(function(){
            
          
             $.post('./login.php', $('form').serialize(), function(data) { 
               
                if(data == 1){
                   alert ('添加成功');
                     $("#admin_user").val('');
                     $("#admin_psd").val('');
                     $("#captcha").val('');
                }else{
                   alert ('添加失敗');
                }      
            
            });
            
            });
        
        });

               
         
         
        

        無刷新用戶登錄

    
    
     

                    
                        
                                                                                               
                                              用戶名:                                                                                                                                                                                                             
                                        
                                              密    碼:                                                                                                                                                                                                                  
                                        
                                              ×××:                                                                                                                                                                                                                                             
                                                                         
                                                                                          提交                                                                                            
分享標(biāo)題:ajax無刷新表單提交
當(dāng)前URL:http://weahome.cn/article/iiiiec.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部