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
Api System Problem
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="Bazinga" data-source="post: 20672" data-attributes="member: 753"><p>Hello, well I'm having a problem with rewarding the users with credits, I've added the right codes and the variables work so I don't know why the codes won't work</p><p>[php]<?php</p><p>//////////////////////////////////////////////////////////////</p><p>// # TheHabbos Topsites API Script - Release 1.0.0 (BETA 1) //</p><p>// # (C) Copyright TheHabbos 2010. All rights reserved. //</p><p>//////////////////////////////////////////////////////////////</p><p></p><p>/* SCRIPT CONFIG */</p><p></p><p>@include('./_inc/core.php');</p><p>if($userCredentials['name']=='')</p><p> {</p><p> @header('location: '.$My_Path);</p><p> exit;</p><p> }</p><p>$TheHabbos_User = 'cloudhabbo';</p><p>$Credits_Reward = '50';</p><p>$USERNAME = $userCredentials['name'];</p><p>?></p><p><head></p><p><?php @include('./_inc/information.php'); ?></p><p></p><p> <title>CloudHabbo: Thank you for voting!</title></p><p> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p><p></p><p> <link rel="shortcut icon" href="<?php echo $My_Path; ?>images/favicon.ico" type="image/vnd.microsoft.icon" /></p><p> <style></p><p> @import "<?php echo $My_Path; ?>_inc/style.css";</p><p> </style></p><p></head></p><p><table id="overview_overlay" align="center"></p><p> <tr id="overview_verticaltop"></p><p> <td></p><p> <div id="overview_overlay_1"></p><p><?php</p><p>/* VALIDATION SCRIPT */</p><p></p><p>ob_start();</p><p>$handle = fopen('http://api.thehabbos.org/validate.php?user='.$TheHabbos_User.'&ip='.$_SERVER['REMOTE_ADDR'], 'r');</p><p>if(!$handle) {</p><p> echo 'TheHabbos seems to be having connection issues. :(';</p><p>}else{</p><p> $validateCode = stream_get_contents($handle);</p><p> fclose($handle);</p><p> </p><p> if($validateCode == 1) {</p><p> //what happens if someone does successfully vote</p><p> mysql_query("</p><p> UPDATE 'users'</p><p> SET 'credits' = 'credits' + '".$Credits_Reward."'</p><p> WHERE 'name' = '".$USERNAME."'");</p><p> ?></p><p> <h1 style="color: green;">Success!</h1><br /></p><p> You have successfully voted and recieved 50 credits!<br /></p><p> <br /></p><p> <a href="/">Return to cloud</a></p><p> <?php</p><p> }else{</p><p> //what happens if someone doesn't successfully vote</p><p> ?></p><p> <h1 style="color: red;">Oh no, something went wrong!</h1><br /></p><p> It appears that you have already voted today so you will recieve no credits.<br /></p><p> <br /></p><p> <a href="/">Return to cloud</a></p><p> <?php</p><p> }</p><p>}</p><p>?></p><p> </td></p><p> </tr></p><p> </table>[/php]</p><p></p><p>All looks fine to me but upon voting successfully no credits are given, any suggestions?</p><p> Edit:</p><p>Core is included</p><p>Variables; all echoed out so they work..</p><p></p><p>Still doesn't work :S</p></blockquote><p></p>
[QUOTE="Bazinga, post: 20672, member: 753"] Hello, well I'm having a problem with rewarding the users with credits, I've added the right codes and the variables work so I don't know why the codes won't work [php]<?php ////////////////////////////////////////////////////////////// // # TheHabbos Topsites API Script - Release 1.0.0 (BETA 1) // // # (C) Copyright TheHabbos 2010. All rights reserved. // ////////////////////////////////////////////////////////////// /* SCRIPT CONFIG */ @include('./_inc/core.php'); if($userCredentials['name']=='') { @header('location: '.$My_Path); exit; } $TheHabbos_User = 'cloudhabbo'; $Credits_Reward = '50'; $USERNAME = $userCredentials['name']; ?> <head> <?php @include('./_inc/information.php'); ?> <title>CloudHabbo: Thank you for voting!</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="<?php echo $My_Path; ?>images/favicon.ico" type="image/vnd.microsoft.icon" /> <style> @import "<?php echo $My_Path; ?>_inc/style.css"; </style> </head> <table id="overview_overlay" align="center"> <tr id="overview_verticaltop"> <td> <div id="overview_overlay_1"> <?php /* VALIDATION SCRIPT */ ob_start(); $handle = fopen('http://api.thehabbos.org/validate.php?user='.$TheHabbos_User.'&ip='.$_SERVER['REMOTE_ADDR'], 'r'); if(!$handle) { echo 'TheHabbos seems to be having connection issues. :('; }else{ $validateCode = stream_get_contents($handle); fclose($handle); if($validateCode == 1) { //what happens if someone does successfully vote mysql_query(" UPDATE 'users' SET 'credits' = 'credits' + '".$Credits_Reward."' WHERE 'name' = '".$USERNAME."'"); ?> <h1 style="color: green;">Success!</h1><br /> You have successfully voted and recieved 50 credits!<br /> <br /> <a href="/">Return to cloud</a> <?php }else{ //what happens if someone doesn't successfully vote ?> <h1 style="color: red;">Oh no, something went wrong!</h1><br /> It appears that you have already voted today so you will recieve no credits.<br /> <br /> <a href="/">Return to cloud</a> <?php } } ?> </td> </tr> </table>[/php] All looks fine to me but upon voting successfully no credits are given, any suggestions? Edit: Core is included Variables; all echoed out so they work.. Still doesn't work :S [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Miscellaneous
FindRetros
Help & Support
Api System Problem
Top