Ajax pass parameters, PHP can't get the solution

Source: Internet
Author: User
Ajax pass parameters, PHP cannot get
The AJAX code is as follows:
JScript Code
  
   Type: ' POST ', url: '. /php/a.php?id= ' + ' abc ', Success:function (data) {    alert (data);}

The PHP code is as follows:
PHP Code
  
   echo $_get[' ID '];

Why does the JS file pop up the "ABC" dialog box, and the PHP page has nothing to do with it?

------Solution--------------------
What do you mean, "nothing"? How did you access that. Do you have an ID on the URL?
------Solution--------------------
No way. Now that Ajax is available. Indicates that PHP returned a value. /a.php?id=33 is this the way to visit?
------Solution--------------------

Ajax.html
HTML Code
            
  
                                                           
------Solution--------------------
Landlord sure you can run PHP?
------Solution--------------------
Otherwise, the landlord tries to add a random number to the get parameter, and is not cached by the browser.
------Solution--------------------
Oh, it's the get parameter on the post, not the caching problem.
------Solution--------------------
Explore

Reference:

No way. Now that Ajax is available. Indicates that PHP returned a value. /a.php?id=33 is this the way to visit?

Even more oddly, if a.php is using Var_dump ($_get[' ID "), then a pre tag will appear in the JS popup dialog, with the ID value in the pre tag.

------Solution--------------------
It is estimated that the Internet Explorer cache problem, after modifying the JS code, to clear the browser cache
------Solution--------------------
Are you sure the parameters have been put through when you jump to the PHP page?
  • 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.