Basically, I have customized the API (Beta 2) to my liking, but for some reason the queries are not working.
Suggestion: Make a way for us to test the API (eg a test account we can vote for a million times a day, or a URL we can link it to (sandbox.thehabbos.org) where instead of a vote, it will let us pick which message we would like to receive (1 = Successfuly Voted, 2 = Voted Already, 3 = Hasnt voted, 4/5 = Invalid Request, 6 = Connection Error) as it is detailed in the API.
However, mine is failing.
NOTE: I have included core.php and mus.php in the includes.php file.
Also NOTE: The Redirect header (me.php?vote=1) is working perfectly.
In testing this (for PHP errors) I placed it in me.php if a $_GET['vote'] variable exists. It worked everytime. So idk what the problem is.
Suggestion: Make a way for us to test the API (eg a test account we can vote for a million times a day, or a URL we can link it to (sandbox.thehabbos.org) where instead of a vote, it will let us pick which message we would like to receive (1 = Successfuly Voted, 2 = Voted Already, 3 = Hasnt voted, 4/5 = Invalid Request, 6 = Connection Error) as it is detailed in the API.
However, mine is failing.
PHP:
case 1:
{
//what happens if someone does successfully vote
$get_hp = mysql_query("SELECT * FROM users WHERE id = '".$my_id."'") or die(mysql_error());
$hp = mysql_fetch_assoc($get_hp);
$creds = $hp['credits'];
$hp = $hp['honor_awarded'];
$new_hp = $hp + $CONFIG['Honor'];
$new_creds = $creds + $CONFIG['Credits'];
mysql_query("UPDATE users SET `honor_awarded` = '".$new_hp."', `credits` = '".$new_creds."' WHERE `id` = '".$my_id."'");
@SendMusData('UPRC' . $my_id);
header('Location: me.php?vote=1');
break;
}
NOTE: I have included core.php and mus.php in the includes.php file.
Also NOTE: The Redirect header (me.php?vote=1) is working perfectly.
In testing this (for PHP errors) I placed it in me.php if a $_GET['vote'] variable exists. It worked everytime. So idk what the problem is.