frooyo
frooyo

Reputation: 1953

Lua/WebDevelopment - How to get URL variables?

I'm using Lua for web development.

How do I retrieve URL (get) variables?


For example http://example.com/?varA=999

Psuedo Lua code:

local varA = url.get(varA);  -- varA = 

Upvotes: 1

Views: 1141

Answers (2)

develCuy
develCuy

Reputation: 625

If you are running your Lua code in Lua, you can use request_path() and request_uri() to read the URL, and global _GET for a parsed version that correspond to the URL get variables you mention.

Upvotes: 0

Mud
Mud

Reputation: 28991

Lua's standard library doesn't do networking. Check out LuaSocket.

Upvotes: 2

Related Questions