In page a.php, you want to count the number of elements (picture/link) clicks in the page and store the clicks.
PHP is currently interacting with the database, so I want the user to click (Image/Link), PHP can react, to update the database in the corresponding table.
Excuse me, what method can I use to trigger the reaction of PHP when I click (Picture/link) ~ ~
Reply to discussion (solution)
Using Ajax
Use Ajax, or curl.
The quickest way is to use jquery's $.ajax method.
Use Ajax, or curl.
The quickest way is to use jquery's $.ajax method.
--------------------------------------------------------------
Using Ajax
---------------------------------------------------------------
Excuse me, can you use JS method to call Ajax?
You should look at the basic books. Or download some CHM documents and read about the Jquery.ajax chapter.
You should look at the basic books. Or download some CHM documents and read about the Jquery.ajax chapter.
------------------------------------------------------------------------------------------------------
Is this the only way to crash?
I'll give you a demo.
Need to download a jquery.js
$.ajax ({
Type: "POST",//Request method
URL: "some.php",//Request file
Data: "Name=john&location=boston",//parameters of the transmission
Success:function (msg) {
Alert ("Data Saved:" + msg);//Returns the result
}
});
Ajax can be seen as a form request. But you can return the results in real time
I'll give you a demo.
Need to download a jquery.js
$.ajax ({
Type: "POST",//Request method
URL: "some.php",//Request file
Data: "Name=john&location=boston",//parameters of the transmission
Success:function (msg) {
Alert ("Data Saved:" + msg);//Returns the result
}
});
Ajax can be seen as a form request. But you can return the results in real time
-------------------------------------------------------------------------------
And then, in some.php, get John through $_post[' name '?
I'll give you a demo.
Need to download a jquery.js
$.ajax ({
Type: "POST",//Request method
URL: "some.php",//Request file
Data: "Name=john&location=boston",//parameters of the transmission
Success:function (msg) {
Alert ("Data Saved:" + msg);//Returns the result
}
});
Ajax can be seen as a form request. But you can return the results in real time
-----------------------------------------------------------------------------
What PHP should get is a string, right?