mardi 4 août 2015

Choosing the best way to get a variable to a php script

For my project I need to do the following:

  1. User presses his Mouse on the canvas (html page)
  2. JavaScript function saves the coordinates of the points that have been pressed
  3. Send this info to a PHP script
  4. PHP script adds this data to MySQL database
  5. Other coordinates are put into JSON and sent to back to the client and presented on the same canvas

Now, I have looked into the problem of step 3 (which is something I don't know how to do). There are different ways, I have selected these two:

  1. Using Ajax
  2. HtmlRequest (answer 3)

Which would be the best way to choose in my situation? Is there yet a better / right way to do it?

Aucun commentaire:

Enregistrer un commentaire