Hello, I was searching around, and came across this code to send coins to user. I was just wondering if anyone knew how to use it.
Code:<?php if(isset($_POST['changecoins'])) { $type = $_POST['type']; $id = $_POST['id']; $coins = $_POST['coins']; if( $type == 0 ) { $query02 = mssql_query("SELECT AID FROM Login(nolock) WHERE UserID = '$id'"); $part = "UserID"; } elseif( $type == 1 ) { $query02 = mssql_query("SELECT UserID FROM Login(nolock) WHERE AID = '$id'"); $part = "AID"; } else { die(); } if( mssql_num_rows($query02) != 1 ) { die("Account doesn't exists"); } else { mssql_query("UPDATE Login SET Coins = Coins + $coins WHERE $part = '$id'"); die("Coins added succesfully"); } } ?> <h3>Add Coins</h3> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <select name="type"> <option value="0">UserID</option> <option value="1">AID</option> </select> <input type="text" name="id" /> Coins: <input type="text" name="coins" /> <input type="submit" name="changecoins" value="Add Coins" /> </form>


Reply With Quote


