Hi, is there a standard way to load information to a php script? In the end I want to store something in my MySQL database.
So , the idea is to first get the mouseX, mouseY inputs through p5.js -> send to php -> MySQL.
Usually it is done via html POST or GET methods. GET is performed by simply adding variables to the php page like this:
yourpage.php?mouseX=100&mouseY=200
You can't however just pass variables directly, as javascript only runs in your browser, you need to create a query, like a string above. You may search the internet for examples of "javascript to php" and "GET method"
Answers
Usually it is done via html POST or GET methods. GET is performed by simply adding variables to the php page like this: yourpage.php?mouseX=100&mouseY=200 You can't however just pass variables directly, as javascript only runs in your browser, you need to create a query, like a string above. You may search the internet for examples of "javascript to php" and "GET method"
Good! I will! Thanks!
Ok! Got into some trouble:
This is my JS script:
and this is the PHP code:
I get the successful message, but nothing gets inserted into the table. Why is that?