[solved] HTTP GET/POST with PHP/MySQL

Okay, the facts.

  1. I need my game to send information to my server.
  2. I need the server to deny the information if the game tries to send it too often.
  3. I needed a way to identify the game/user, so I selected the “deviceID”, as it is pretty unique.
  4. I can manually enter my information, and deviceID, into my MySQL database using PHP MyAdmin.
  5. I wrote a PHP script that the game sends the information to. The script enters the info into the DB.
  6. If I send the deviceID, the entry fails. If I send a text string, the entry fails. If I send a number, it works.
  7. The location of the deviceID in my database is NOT an INT, or number, instead it is a text string.
    Being that I can enter this data manually, and it works fine, I have to assume that PHP is choking/having an issue with the data.

Currently, I am using GET for passing data, and I produce something like:

http://www.myserver.com/update.php?float1=345.448&float2=678.158&device=add6aa7e36b2003a85de9e51a509c5da&target=34

Would using POST work instead? And if so, how do I use POST with the Async HTTP?

I understand this:

network.request("http://www.myserver.com/update.php", "POST")  

The params part, however, I am yet unclear on. Do I pass the variables in the header or body?

Thanks so much for any help. This has gotten very frustrating.
UPDATE: Solved it. Forced a ’ before and after the string and it worked.
[import]uid: 30399 topic_id: 11285 reply_id: 311285[/import]

Hi.

I’m also curious about this, did you solve it like:

http://www.myserver.com/update.php?float1='345.448'&float2='678.158'&device='add6aa7e36b2003a85de9e51a509c5da&target=34'

or

http://www.myserver.com/update.php?'float1=345.448&float2=678.158&device=add6aa7e36b2003a85de9e51a509c5da&target=34'

Cheers,
Dan [import]uid: 29676 topic_id: 11285 reply_id: 41036[/import]

The floating points didn’t need to have anything done to them, because they were easier to pass in the first place. However, for the ID, I did this:

"http://www.server.com/parse.php?info=\'" .. stringToPass .. "\'"

I had to use a ’ before and after the text string in order to get PHP to work with it. Now, it works like a charm.

So, ’ before and after the text strings. [import]uid: 30399 topic_id: 11285 reply_id: 41093[/import]