| View previous topic :: View next topic |
| Author |
Message |
darklitch
Joined: 03 Oct 2005 Posts: 11
|
Posted: Mon Feb 13, 2006 2:28 am Post subject: lua with php |
|
|
I need to send post data to a php file. Once I connect to my server, how do I send the request? Without the data it is something like:
test = socket:send("GET /test.php HTTP/1.0\r\n")
test = socket:send("host: www.somewebsite.com\r\n\r\n") |
|
| Back to top |
|
 |
modsyn
Joined: 27 Sep 2005 Posts: 28
|
Posted: Mon Feb 13, 2006 9:16 am Post subject: |
|
|
well, first you'd need to get the data you're sending somehow in your
lua application.
| Code: | varname1 = "data1"
varname2 = "data2" |
then, you'd need to format that (or url-encode it) to send with your socket
| Code: | test = socket:send("POST /test.php?var1="..varname1.."&var2="..varname2.." HTTP/1.0\r\n")
test = socket:send("host: www.somewebsite.com\r\n\r\n")
|
of course, you probably are doing something more complex than that.
but i think that should answer most of your question. |
|
| Back to top |
|
 |
|