forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lua with php

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
darklitch



Joined: 03 Oct 2005
Posts: 11

PostPosted: Mon Feb 13, 2006 2:28 am    Post subject: lua with php Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
modsyn



Joined: 27 Sep 2005
Posts: 28

PostPosted: Mon Feb 13, 2006 9:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group