Anyone got a working badge shop for rev cms because I use this script and it doesnt work
Okay so this is what happens everything works the images show up but when I click buy badge it takes me to hotelurl/index.php?url=badge&id=ES029 and gives me a blank page how do I fix this problem and if you guys have another badge shop please do share?Code:</ul> </div>
</div>
<div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="column1" class="column">
<div class="habblet-container">
<div class="cbb clearfix blue">
<h2 class="title">Badge Store</h2>
<div id="Credits-info" class="box-content Credits-info">
<div class="Credits-info-text clearfix">
<center>Select the badge that you would like to purchase.</center>
<hr style="margin: 10px 0;" />
<centeR><i>We currenly have 20 badges for sale!</i></center>
<?php
// Create Array for Badge Codes/Costs in Credits
$badgeCodes = array('HH1', 'GM1', 'GM2', 'GM3', 'UK120', 'UK119', 'UK067', 'UK045', '70S', 'DN4', 'DS3', 'DS6', 'ES033', 'ES029', 'ES9', 'ES3', 'ES5', 'FR5', 'FR9', 'FR033', 'FR036', 'FR4', 'FR8');
$badgeCosts = array(10, 10000, 8000, 5000, 25000, 15000, 5000, 2000, 9000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000);
$subCode = $_GET['id'];
if(isset($subCode)){
$badgeExsist = false;
for($i = 0; $i < sizeof($badgeCodes); $i++){
if($subCode == $badgeCodes[$i]){
// Check to see if user has badge
$hasBadgeCheck = mysql_query('SELECT * FROM user_badges WHERE user_id = '.$_SESSION['user']['id'].' AND badge_id = "'.$badgeCodes[$i].'"')or die(mysql_error());
if(mysql_num_rows($hasBadgeCheck) < 1){
// check Credits
$creditCheck = mysql_query('SELECT * FROM users WHERE id = '.$_SESSION['user']['id'].'')or die(mysql_error());
$gotCreditCheck = mysql_fetch_assoc($creditCheck);
if($gotCreditCheck['credits'] >= $badgeCosts[$i]){
$removeCredits = mysql_query('UPDATE users SET Credits = Credits - '.$badgeCosts[$i].' WHERE id = '.$_SESSION['user']['id'].'')or die(mysql_error());
$giveUserBadge = mysql_query('INSERT INTO user_badges (user_id, badge_id) VALUES ('.$_SESSION['user']['id'].',"'.$badgeCodes[$i].'")')or die(mysql_error());
$_SESSION['user']['credits'] = $_SESSION['user']['credits'] - $badgeCosts[$i];
echo '<div id="badge-container-error" style="background-color:green;"><center><font color="white"> You have recived the badge! You may have to reload.</font></center></div>';
break;
}
else{
// You don't have enough Credits
echo '<div id="badge-container-error">You do not have enough Credits.</div>';
}
}
else{
// You have badge
echo '<div id="badge-container-error">You already have this badge.</div>';
}
break; // stop loop
}
}
}
echo '<table>';
echo '<tr><td><strong>Badge</strong></td><td><strong>Badge Name</strong></td><td><strong>Cost</strong></td><td><strong>Buy</strong></td></tr>';
for($n = 0; $n < sizeof($badgeCodes); $n++){
// Check to see if user has badge
$hasBadge = mysql_query('SELECT * FROM user_badges WHERE user_id = '.$_SESSION['user']['id'].' AND badge_id = "'.$badgeCodes[$n].'"')or die(mysql_error());
if(mysql_num_rows($hasBadge) < 1){
echo '
<tr>
<td width="50%">
<img src="/game/c_images/album1584/'.$badgeCodes[$n].'.gif"/>
<br/>
</td>
<td width="10%">
<center><strong>'.$badgeCodes[$n].'</strong></center>
</td>
<td width="10%">
<center>'.$badgeCosts[$n].' Credits</center>
</td>
<td width="30%">
<center><a href="{url}/index.php?url=badge&id='.$badgeCodes[$n].'"><input type="submit" href="{url}/index.php?url=badge&id='.$badgeCodes[$n].'" value="Buy Now"/></a></center>
</td>
</tr>
';
}
else{
// Don't show the badge.
}
}
echo '</table>';
?>
</div></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
<div id="footer" >
<?php include('includes/footer.php'); ?>
<?php include('includes/checktheban.php'); ?>
</div>
</body>
</html>

