Solved PHP Server not reading post data

Discussion in 'Spigot Plugin Development' started by TheCrystalStar, Jul 12, 2018.

Thread Status:
Not open for further replies.
  1. Going to just use a database.
     
    #1 TheCrystalStar, Jul 12, 2018
    Last edited: Jul 13, 2018
  2. This doesn't really pertain to the Spigot API. You might find better help on StackOverflow
     
  3. Not particularly relevant, but that's not a good way to do JSON... look up Gson.
     
  4. 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
     
  5. 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
     
  6. 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?
     
  7. You can make Java Http Server which listens on some port and when it recieves certain request make it send data back to php.
     
Thread Status:
Not open for further replies.

Share This Page