$_get method cannot get URL value

Source: Internet
Author: User
My code is like this.

In 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+ "", ' 111 ', ' height=620,width=500,top= ' +top+ ', left= ' + Left+ ', Toolbar=no,menubar=no,scrollbars=no, Resizable=no,location=no, Status=no ');
},
});


Newly opened page URL: http://localhost/yemian/admin/photo?id=31
In the newly opened page
echo $id =$_get[' id '];

However, the $_get[' ID ' is not available;


Reply to discussion (solution)

Type: ' POST ',
You specify the post mode, $_get of course not to take

Type: ' POST ',

You're using the Post method,
You should use echo $id =$_post[' id ']; To get

Or put jquery's
Type: ' POST ',
Switch
Type: ' GET ',

Type: ' POST ',
You specify the post mode, $_get of course not to take


Landlord is the first post,post back, then jump to the new page.

The landlord himself checked, whether the value passed past

Success:function (data) {
alert (data);
See what data has.

The first few are misleading, and the get on the URL does not matter with the Ajax post and get.
You have to check the URL of the real access, is not with the parameters passed, if it is, re-check is not handled by the URL rewrite.

Http://localhost/yemian/admin/photo?id=31

That's right.
Then Print_r ($_get);
See what you got.

Http://localhost/yemian/Admin/Photo
Http://localhost/yemian/admin/photo?id=31

Is there a case, these two are the same page? Check that you changed the file?

Oh, I'm going to make a super-low 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.