Bazinga
Posting Freak
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
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
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>
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