Pass data to database using javascript Onclick

后端 未结 3 1456
甜味超标
甜味超标 2021-01-16 14:32

I am a real noob when it comes to javascript/ajax, so any help will be very appreciated. In reference to this question:

Updating a MySql database using PHP via an o

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-16 15:16

    What you would do is on the php server side have a page lets say its update.php. This page will be visited by your javascript in an Ajax request, take the request and put it in a database.

    The php might look something like this:

    Your javascript would simply preform an ajax request on update.php and send it the variables as get value "score".

提交回复
热议问题