1 registered members (AndrewAMD),
645
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[ANET] HTTP Send Score
#295357
10/24/09 17:32
10/24/09 17:32
|
Joined: Jun 2008
Posts: 428
Rasch
OP
Senior Member
|
OP
Senior Member
Joined: Jun 2008
Posts: 428
|
Hi iīve tried to send scores to my mysql server. Everything works and it also says that itīs sended. But nothing get written in the database what did i wrong? I took the template code. The sql server runs on my own machine and i can see the php pages. but they just give me back -1 I created the database like in the manual and also created the needed rows and so on. And how i said it says that itīs "Gesendet" but nothing changes in the database.
function send()
{
player_points ī+= random(49)+5;
STRING* http_url = "#100";
STRING* http_data = "#250";
STRING* http_result = "#10";
var httpID;
//URL:
str_cpy(http_url,"http://localhost/php_scripts/game_to_onlinelist.php");
//Data:
inkey_playername.flags = VISIBLE;
inkey(http_playername);
inkey_playername.flags &= ~VISIBLE;
str_cpy(http_data,"svn=");
str_cat(http_data,http_playername);
str_cat(http_data,"&pw=");
str_cat(http_data,player_points);
httpID = http_post(http_url,http_data);
while(http_get_status(httpID) == 0) {wait(1);}
if(http_get_status(httpID) == 1)
{
http_get_result(httpID,http_result);
error("Gesendet!");
}
else
{
error("Nicht gesendet!");
}
http_free(httpID);
}
|
|
|
Re: [ANET] HTTP Send Score
[Re: Rasch]
#295365
10/24/09 19:27
10/24/09 19:27
|
Fear411
Unregistered
|
Fear411
Unregistered
|
maybe there is an error in your php file.
|
|
|
Re: [ANET] HTTP Send Score
[Re: Rasch]
#295378
10/24/09 21:04
10/24/09 21:04
|
Fear411
Unregistered
|
Fear411
Unregistered
|
I will post an example tomorrow, cause i am not at the pc now. Whats inside the php file, if you are allowed to post it?
|
|
|
Re: [ANET] HTTP Send Score
[Re: ]
#295383
10/24/09 21:41
10/24/09 21:41
|
Joined: Jun 2008
Posts: 428
Rasch
OP
Senior Member
|
OP
Senior Member
Joined: Jun 2008
Posts: 428
|
Omg i found out what the problem was.
In the php script there was:
$change = "UPDATE gamelist Set servername = '$servername', password = '$pw', gametyp = '$gametyp', map = '$map', serverip = '$serverip', lastupdate= '$timestamp', players='$players', ping='$ping', id = '$id' WHERE row = '$entry_row'"; mysql_query($change);
and i changed to
mysql_query("INSERT INTO gamelist (row, servername, password, id) VALUES ('$entry_row', '$servername', '$pw', '$id')");
the update function didnt work it had to be inputed
|
|
|
Re: [ANET] HTTP Send Score
[Re: Rasch]
#295435
10/25/09 10:01
10/25/09 10:01
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Why do you use the internet-serverlist php code for an online highscore?
Btw. if you want to create an internet-serverlist, use the template and read through the howto. Then there should be no problem.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANET] HTTP Send Score
[Re: Rasch]
#295581
10/26/09 09:55
10/26/09 09:55
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
You should write such a snippet yourselfe. Creating a online highscore in php is really easy. If you need help, you can ask on a php forum or here.
The template tells you that you are not allowed to use it? That's strange, can you post a screenshot?
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANET] HTTP Send Score
[Re: Dark_samurai]
#295759
10/27/09 13:03
10/27/09 13:03
|
Joined: Aug 2005
Posts: 1,230
MichaelGale
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,230
|
And while you are at it, read a good article about SQL injection attacks.
Your friendly mod is at your service.
|
|
|
|