I am trying to setup something so I can get variables from my app, to display on a website and become variables on the website. I have a login screen on a webpage that I need to get my games Score and games Mode data on. My website is just a blank page with no body code because I am adding it all in within the app.
So my webpage looks like this…
[html]
<title>Login</title>
[/html]
In my code, I tried setting up all of the body code for the webpage like this
local params = {}
local ranmdomScore = 65768
local randomMode = "Test2"
local textPost = '<font color="red"> <form method="get" action="postScore.php"> UserName: <input type="text" name="Name"><br> Password: <input type="password" name="Password"><br> <input type="hidden" name="gameScore" value="..ranmdomScore.."> <input type="hidden" name="gameMode" value="..randomMode.."> <input type="submit" name="submit" value="Login"> </form> </font>'
params.body = textPost
network.request( "MyWebPageInfo.php",
"POST", networkListener, params)
native.showWebPopup( display.contentWidth/4, display.contentHeight/5, 280, 210,
"MyWebPageInfo.php")
(My actual code does not use MyWebPageInfo.php, it’s the real http address I’m using)
I need to have the gameScore entered to the website in the form using a variable in my app and the same for the gameMode, that is the main reason for me writing all of the body code in my lua app so that I can setup those variables on the website.
Once I post the data, I then launch the WebPopup with the same website I just edited, when I launch it, I just get a blank black page without any of the form data on it.
I can’t figure out how to get the data to post to the website. I have tried using POST and GET.
**EDIT: I changed the way my PHP pages are setup and sent all of the info needed to the webpage using the native.showWebPopup feature
example:
native.showWebPopup( display.contentWidth/3+30, display.contentHeight/5, 280, 210,
"MyWebSite.php?gameScore="..gamePoints.."&gameMode="..gameMode)
Now everything is working.**
[import]uid: 69700 topic_id: 17395 reply_id: 317395[/import]