First File
table.php:
PHP Code:
<?php
include("value.php");
$percent = ($value1 / $value2) * 100;
$percent = round($percent)."%";
echo ("<table width=\"150\" border=\"0\"><tr>");
echo (" <td width=\"".$percent."\" bgcolor=\"green\" height=\"10\">".$value1." </td>");
if ($percent!="100") { echo("<td bgcolor=\"red\" align=\"right\">".$value2."</td>"); }
echo ("</tr><table>");
echo ("<br /><br />".$value1."/".$value2);
?>
Second File
value.php:
PHP Code:
<?php
$value1="682";
$value2="1400";
?>