Need some help with displaying Total Amount Earned on banner image

Hi there,

I have a matrix program where many people have already earned a fair amount of money!

I am in the process of creating a banner, that shows the amount earned by the individual.

The banner can be seen here:

The code contained in the file is as follows:

<?php $id=$_GET['u']; include "config.php"; $id=$_SESSION["username_session"]; $rs = mysql_query("select * from users where Username='$id'"); $arr=mysql_fetch_array($rs); $check=1; $email=$arr[7]; $name=$arr[1]; $ref=$arr[11]; $username=$_SESSION[username_session]; $status=$arr[14]; if($status==1) { $statust="Free"; } else { $statust="Pro"; } [b]$total=$arr[15];[/b] $paid=$arr[17]; $unpaid=$arr[16]; $xImg = ImageCreateFromJPEG('images/stats.jpg'); $col = imagecolorallocate($xImg, 11, 11, 97); imagestring($xImg, 5, 300, 33, '$'[b].$amount['total'][/b], $col); header('Content-type: image/jpeg'); imagejpeg($xImg, NULL, 100); ?>

Now, the following lines are also in the header of the members area, where members can see their stats, eg total earned and so on and the code does work:

include “config.php”;
$rs = mysql_query(“select * from users where Username=’$id’”);
if($status==1) {
else {

so they wirk, IF you look at the image, everything is displayed even the $ sign, however, it will NOT show the amount, no matter what I have tried, grrrrrrrrrrrr

Help please
Tom Taylor

I have a feeling


Is empty, i don’t see where you set the $amount array?

Based on the code you are showing, try changing…

[php]imagestring($xImg, 5, 300, 33, ‘$’.$amount[‘total’], $col);[/php]


[php]imagestring($xImg, 5, 300, 33, ‘$’. $total, $col);[/php]

The reason why I say this is because I see the $total variable being set. I don’t know if that’s the total you’re looking for, but it’s the only total looking variable in the code samples you showed us.

Sponsor our Newsletter | Privacy Policy | Terms of Service