rooxx102
New Member
- Messages
- 18
- Reaction score
- 0
- Points
- 1
This is my code and I need it so when a user type lets say 50 cash it will give the user + 500 bux and -50 cash if they have 50+ cash.
PHP:
<center>
<h1>Trade Currency</h1>
You Have <? echo "$myU->Bux" ?> Bux and <? echo "$myU->Cash" ?> Cash<p>1
<font color='orange'>Cash</font> = 10 <font color='green'>Bux</font> <br>
10 <font color='green'>Bux</font> = 1
<font color='orange'>Cash</font></p>
<form action='' METHOD='POST'><b>Amount Cash: </b>
<input type='text' name='Cash'><br>
<input type='submit' name='trade' value='Trade'>
</form>
<form action='' METHOD='POST'>
<b>Amount Bux: </b>
<input type='text' name='Bux'><br>
<input type='submit' name='trade' value='Trade'>
</form>
<?
$submit = $_POST['submit'];
$Cash = $_POST['Cash'];
$Bux = $_POST['Bux'];
if($User) {
if (isset($_POST['Cash'])) {
$Cash = $_POST['Cash'];
$Bux = 10 * $Cash;
}
else
{
if(isset($_POST['Bux'])) {
$Bux = $_POST['Bux'];
$Cash = $Bux / 10;
}
}
}
?>
Last edited by a moderator: