Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

HTTP PostAsync string to website?

I'm developing a script that logs the players who join the game, here's what I have so far...

local hs = game.HttpService
local url = "http://--SNIP--/currentusers.php"
local data = {
    ["name"] = player.Name,
    ["userid"] = player.UserId
}
data = hs:JSONEncode(data)
gotback = hs:PostAsync(url, data)
data = hs:JSONDecode(data)
print("successfully ammended "..player.Name..","..player.UserId.."to the php file as string!")

I have absolutely no clue how to get "name" and "userid" to be sent as string to the php file, and stay there. I don't know if I'm even on the right track, or completely off. Please let me know!

Thank you!

1 comment

0

Closing this question as you are asking a PHP related question, not Lua. However, see this link for info to help you: http://stackoverflow.com/questions/9597052/how-to-retrieve-request-payload

1 answer

Im not sure, but try using :tostring(------), Of course i have no skill in this, but just an idea.

This discussion is preserved as it was. New answers, comments, and votes are closed.