I would like to fill a database with app/device info within my app (when a user run my app for the first sent info about date, device,...) so i can have a few statistics.
How do i do it? I have no idea of php...
Quote from: ampos on 2012-Feb-28
I would like to fill a database with app/device info within my app (when a user run my app for the first sent info about date, device,...) so i can have a few statistics.
How do i do it? I have no idea of php...
http://www.w3schools.com/php/php_post.asp
Send the parameters in a form or query and just save it to a delimited text file for now.
You would use NETWEBGET$ to send the data to the PHP web file.
There are some examples in the samples (as usual :-)
Can't remember the name but try searching on .php, there should be sources for the server around there too.
This is some code for a highscore table that I used that you could easily adapt
NETWEBGET$("websitehome.co.uk", "/poststats.php?n=" + YourName$ + "&s=" + Distance, 80, 4096)
And the php saved as poststats.php and placed in your server location @ websitehome.co.uk
<?php
$nam = $_GET["n"];
$sco = $_GET["s"];
$con = mysql_connect("YourDB.co.uk","YourDBname","YourPassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("YourDBname", $con);
$result = mysql_query( "INSERT INTO HIGHSCORE (Name, Score)
VALUES ( '" . $nam . "', '" . $sco . "' ) " );
mysql_close($con);
?>
Obviously this could be adapted to use blowfish for encryption but thats up to you....this is old code and never did.
Included is the PHP code I use to process uploaded scores :
And the GLBasic code to send to it :
/hs/new_score.php?send="+URLENCODE$(ENCRYPT$(PLATFORMINFO$("HOSTID")+"acode",setup.ReturnProgName$()+","+name$+","+score%+","+setup.ReturnCountryCode$()+","+setup.ReturnPlatform$()+","+gameMode%+",anothercode"))
[attachment deleted by admin]