国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - PHP?? ???? ???? ?????. ?????.
某草草
某草草 2017-05-16 13:01:04
0
8
869

?? ????? ????? ??? ???? ????? ???? ???. ??? ??? ????, ?????? ???? ???? ????? ??? ???? ???? ?? ?????. ? ???? ?????. ??? ?? ??? ????

?? ??? ??? URL? ???????. ??? data.php? 6? $action ?????. ?? ?? ???? ?????? ??? ???????? ???? ??? ? ????. ???? PHP?? ??? ??? ????? ????

?? ?:
php:

//?? ??? Action? url? ???????. ??? data.php? 6?? ????.
    $action = $_GET['??'];

    ???($??) {
        'init_data_list'? ??:
            init_data_list();
            ????;
        ?? 'add_row':
            add_row();
            ????;
        ?? 'del_row':
            del_row();
            ????;
        ?? 'edit_row':
            edit_row();
            ????;
    }

//?? ???, ?????? PHP? ??? ??????? ? ???? ?????? ??? ??? ? ????
    ?? del_row(){
        //??
        /*?? "???!";*/
        
        //??? ????? ????.
        $rowId = $_GET['rowId'];
        $sql = "user_id='$rowId'? t_users?? ??";
        
        if(query_sql($sql)){
            ?? "???!";
        }? ??{
            echo "?? ??!";
        }
    }

?? ?:
? ??? JS:

var $table = $('#table'),
    $?? = $('#??');

$(??() {
    ?????();
    ????();
});

?? ????() {
                $remove.on('??', function() {
                    if(confirm("?? ?????????")) {
                        var ? = $.map($table.bootstrapTable('getSelections'), function(row) {
                            //??? ?? ??? ??? ?????.
                            row.user_id? ?????.
                        });
                    }
                    
                    $.map($table.bootstrapTable('getSelections'),function(row){
                        var del_url = "./php/data.php";
                        //userId? ???? ???? ?????. ? ID? ??? ???? ?????? ?????.
                        var rowId = row.user_id;
                        
                        //PHP ?? ??? ?? ?? ??? ?????? del_row? ?? ???? ???.
                        /*var dataParam = {
                            ??: "del_row",
                            rowId:rowId
                        };*/
                        
                        $.???({
                            ??:"??",
                            url:del_url + "?action=del_row&rowId=" + rowId,
                            ??? ??:"html",
                            ??? ??: 'application/json;charset=utf-8',
                            ??: ??(???) {
                                $table.bootstrap???('??',{
                                    ??: 'user_id',
                                    ?: ?
                                });
                                $remove.prop('????', true);
                            },
                            ??:??(???){
                                Alert('?? ??!');
                            }
                        });
                    });
                })
            }

?? ?:
???? ???? ?? 200?? ?????.

?? URL:http://localhost/muke/php/data.php?action=del_row&rowId=1
?? ??:DELETE
?? ??:200 OK
?? ??:[::1]:80

?? ??? ????
??:del_row
rowId:1

?????? ????, ?? ?? ???? ??? ????: 6?? data.php? ?? ??

??? ???? ?? ??????

?????? ?? ??, ?? ?? ???? ??? ????: 6?? data.php? ?? ??

??? ???? ?? ??????

Rest Client? ???? ???? ??? 200?? ??? ???? ??? ?? ?????! ?? ?????. ??? ????, ? ??? ? ??? ? ? ????. ?? ??? ???? PHP? del_row() ???? ???? ?? ?? ????.
< br>

??? ?? ????

???????? SQL ?? ?????. user_id='1'? t_users?? ??? ????? ???? ?????, ??? ????? ???? ??? ??? ????? ??? ??????.
< /p>

某草草
某草草

?? ??(8)
phpcn_u1582

????? ?? 4?? ??? ????:

  1. ??? ?? ??? ????? $_GET? ???? ?? ? ????.

  2. ?? ??? ????? ??? ?? URL? ????? ???. ??? ????? ??? ?????.
  3. SQL ?? ???? ?? ? ??? ???? ??? ??? ?????.

  4. ???????? SQL ?? ???? ?? ?? ???? ?????? ????? Rest Client? ???? URL ??? ???? ??????.

  5. ??? ?? ??? ??? ?????. ?? ?? ?????? ?? ?? ??? ? ????.

  6. php

???
????? JS ???: ??? ?? ??, ??????? ???:

???
洪濤


?? ???? ???? ??? ?????? ???? $_GET ? $_POST? ???? ????? ??? ? ????.

?? ????? URL? ????? ???.

???
迷茫

?? $userId = $_POST['rowId'];????

???

??? ?

大家講道理

$_GET? ?????. ????? ???? ???? ???

過去多啦不再A夢(mèng)

??? action放在body里了,自然$_GET就取不到action了,要用$_POST。
看你都用了DELETE方式提交了,不如改成restful...

Ty80

???

SQL ?? ??? ???? ???? ?? ? ???? ??????? ??? ? ???? ? ? ??? ???.

習(xí)慣沉默

?? $_GET? ???? ??? ??? ?????.

??? ??? ?? ?????. dataType? json?? ??? ???

??? ???? ??? ?? ????? ?? ? ?? ?????

左手右手慢動(dòng)作

query_sql? ?????? ??? ???? ????