如何在我的PHP文件的URL中获取值

时间:2011-10-16 15:57:01

标签: php url

我正在创建一个这样的网址:

www.mysite.com/xyz.php/0:100003044058740-1:100000657838131-2:100001676304188-3:1075440919-4:100002474721536-5:100003033556875-6:1257699872-7:1257699872-8:100000501703505-9:100000297352382

来自我的.php文件中的这个函数

function finish(){
        var allInputs = $(".gift_user",$("#scrollWrapper"));
        var param = ""; //:

        for(i=0;i < allInputs.length;i++){
            var inEl = $(allInputs[i]);
            var id = inEl.attr("id");
            var val = inEl.val();
            var arr = id.split("_")
            var giftId = arr[2];
            var userId = $.trim(inEl.val());

            if(userId != ""){
                if(param != ""){
                    param = param + "-" ;
                }
                param = param + giftId + ":" + userId ;
            }
        }

        var url = "https://mysite.com/abc.php" + param ;     
         $('#finishButtonContainer').hide();
         $('#processing').show();
        window.location= url;
    }

我想在我的文件abc.php中获取xyz.php之后的值,它将我带入一个数组。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

操作$ _SERVER ['REQUEST_URI']值或将xyz.php之后的值作为queryString传递

示例:

www.mysite.com/xyz.php?0:100003044058740-1:100000657838131-2:100001676304188-3:1075440919-4:100002474721536-5:100003033556875-6:1257699872-7:1257699872-8:100000501703505-9 :100000297352382