$ _ GET method cannot GET url value

Source: Internet
Author: User
$ _ 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.