Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Miscellaneous
FindRetros
Help & Support
TheHabbos API Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Coder" data-source="post: 21799" data-attributes="member: 2121"><p>Basically, I have customized the API (Beta 2) to my liking, but for some reason the queries are not working.</p><p></p><p>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.</p><p></p><p>However, mine is failing. </p><p></p><p>[PHP]</p><p>case 1:</p><p> {</p><p> //what happens if someone does successfully vote</p><p> $get_hp = mysql_query("SELECT * FROM users WHERE id = '".$my_id."'") or die(mysql_error());</p><p> $hp = mysql_fetch_assoc($get_hp);</p><p> $creds = $hp['credits'];</p><p> $hp = $hp['honor_awarded'];</p><p> </p><p> $new_hp = $hp + $CONFIG['Honor'];</p><p> $new_creds = $creds + $CONFIG['Credits'];</p><p> mysql_query("UPDATE users SET `honor_awarded` = '".$new_hp."', `credits` = '".$new_creds."' WHERE `id` = '".$my_id."'");</p><p> @SendMusData('UPRC' . $my_id);</p><p> </p><p> header('Location: me.php?vote=1');</p><p> break;</p><p> }</p><p>[/PHP]</p><p></p><p>NOTE: I have included core.php and mus.php in the includes.php file.</p><p>Also NOTE: The Redirect header (me.php?vote=1) is working perfectly.</p><p></p><p>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.</p></blockquote><p></p>
[QUOTE="Coder, post: 21799, member: 2121"] 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. [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; } [/PHP] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Miscellaneous
FindRetros
Help & Support
TheHabbos API Help
Top