$ _ GET method cannot GET the url value. my code is like this.
Jq
$ ('# Add_user'). ajaxSubmit ({
Url: ThinkPHP ['module'] + '/User/add ',
Type: 'post ',
Success: function (data ){
Alert (data );
Var top = (screen. height-500)/2;
Var left = (screen. width-500)/2;
Window. open ("http: // localhost/yemian/Admin/Photo? Id = "+ data +" ", '000000', 'height = 111, width = 620, top = '+ top +', left = '+ left + ', toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no ');
},
});
New webpage URL: http: // localhost/yemian/admin/photo? Id = 31
In the newly opened page
Echo $ id = $ _ GET ['id'];
However, no $ _ GET ['id'] can be obtained.
Reply to discussion (solution)
Type: 'post ',
You specify the post method. of course, $ _ GET cannot be obtained.
Type: 'post ',
You are using the POST method,
Use echo $ id = $ _ POST ['id']; to obtain
Or put jquery's
Type: 'post ',
Change
Type: 'GET ',
Type: 'post ',
You specify the post method. of course, $ _ GET cannot be obtained.
Post is the first post, post is returned, and then jump to the new page.
The landlord checks whether the value is passed.
Success: function (data ){
Alert (data );
See what data has.
The previous digits are misleading. get on the URL has nothing to do with ajax POST and get.
You need to check whether the real access URL contains a parameter. if so, check whether the URL is overwritten.
Http: // localhost/yemian/admin/photo? Id = 31
This is correct.
Then print_r ($ _ GET );
See what
Http: // localhost/yemian/Admin/Photo
Http: // localhost/yemian/admin/photo? Id = 31
Case Sensitive: are the two pages the same? Check if you have changed the file
Alas, I made a very low-level mistake.