You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyways, I implemented this feature yesterday. (Laravel).
It is not really hard.
Here is how you can do it (VERY BASIC):
Create a random number generator function in PHP (With probability stuff etc) and return the generated number. You can also return a specific value from your database.
Send an AJAX request to the PHP file / route that includes the generator function and store the response text in a variable. (On button click for example).
On AJAX success run the slot machine. Make sure to add the following content to your slot machine before doing so:
randomize() {
return YOURVAR;
}
You are done. Please also be aware of the fact that the images of your slot machine div start at number 0. Number 0 would be picture 1 and so on.
Hello i wana use tricky slot machine with ajax , to choose the numbers to display the result from a database, any ideas?
The text was updated successfully, but these errors were encountered: