Code: Select all
echo "<td><a href=$PHP_SELF?action=buy&amount=1&gem=$i&price=$buyprice>Buy 1</a></td>";
echo "<td><a href=$PHP_SELF?action=sell&amount=1&gem=$i&price=$buyprice>Sell 1</a></td>";* it cant effect the layout meaning ruining it.....so the box for input has to replace Buy 1/Sell 1*
Code: Select all
$gemname=$stockdata[gemname][$i];
$saleprice=ceil($stockdata[baseprice][$i]*(1+$spread));
$buyprice=ceil($stockdata[baseprice][$i]*(1-$spread));
$amount=$stockdata[amount][$i];
echo "<tr><td align=center>$gemname</td><td align=center>$saleprice</td><td align=center>$buyprice</td>";
if ($playerinfo[status]==5) echo "<td align=center>$amount</td>";
echo "<td><a href=$PHP_SELF?action=buy&amount=1&gem=$i&price=$buyprice>Buy 1</a></td>";
echo "<td><a href=$PHP_SELF?action=sell&amount=1&gem=$i&price=$buyprice>Sell 1</a></td>";
echo "<td>$amount</a></td>";
echo "</tr>";
}
echo "</table>";
echo(' <p><center><input name="Submit" type="button" value="Complete Transaction" class="button" /></center></p>'); Also it needs a loop.
It also needs to be able to validate that the user input was an integer
And that it was positive and between 1 and 9999