Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by KiranHart, Jul 12, 2018.
Going to just use a database.
This doesn't really pertain to the Spigot API. You might find better help on StackOverflow
Not particularly relevant, but that's not a good way to do JSON... look up Gson.
Your PHP script will only show data that is sent to the page when you load it. When your plugin posts data to your script it runs it there and then. However when you load that page in chrome you aren't sending any of the post data with your request.
What would be best is to send a post request from the plugin and save the data to a database, or directly save it to a database from your plugin.
Then you can use the datas row ID to view it on a website.
Some info on POST and others: https://www.w3schools.com/tags/ref_httpmethods.asp
I’m aware of post and get methods.
Im still tryna figure out how I can send post data directly to the php page pretty much
Like @JustRayz already said it. You are in the wrong category you could post it in https://www.spigotmc.org/forums/programming.53/ or on stackoverflow.
Also, please don't post a screenshot of your post as it can be really annoying to test your code.
For your question: Try debugging the data before it gets send and see if its formatted correctly.
Also, I don't understand what you are trying on the third screenshot. How is it suppose to work if you open the page by yourself (with no post request) and not with the program?
You can make Java Http Server which listens on some port and when it recieves certain request make it send data back to php.