hmm i'm not good at this. i can't even make the script start to work. i should say i know nothing about php i'm just fiddling trying to make it work.
i've got my value.php file in the same dir. inside this file i only have
$value1="682"; // Amount Recieved
$value2="1400"; // Amount We Need
now i'm trying to use the php you made me print this html, changing the $ from the values in the include file and altering the size of the table to reflect the donations..
Code:
<table width="337" height="52" bgcolor="black" align="center">
<tr>
<td height="26" colspan="2">
<img src="images/donation.gif" width="337" height="26">
</td>
</tr>
<tr height="26">
<td width="65%" bgcolor="#FF0000">
<p align="right">$648 received </p>
</td>
<td>
<p align="right"><font color="red">$880 needed</font></p>
</td>
</tr>
</table>
when i put your code into a file eg.
PHP Code:
<?php
include("value.php");
$percent = ($value1 / $value2) * 100;
$percent = round($percent)."%";
echo ("<table><tr>");
echo (" <td width=\"".$percent."\" bgcolor=\"green\"> </td>");
if ($percent!="100") { echo("<td bgcolor=\"red\"></td>"); }
echo ("</tr><table>");
?>
i get
Quote:
$value1="682"; // Amount Recieved $value2="1400"; // Amount We Need
Warning: Division by zero in e:\foxserv\www\2try.php on line 3
|
i hope its a silly mistake i'm making, i just put the <?php around the whole thing..
thanks for any pointers you can give me...