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?