- Joined
- Jul 22, 2007
- Messages
- 135
- Reaction score
- 0
Hello Guys =]
need you with this script , its MPOG Coins Gift Script
when some one gift a coins for example, 1 user have 20 coins
and he want to gift 10 to his friend.. it sends the coins but the 1st user still have the 20 coins and the 2nd user got 10 coins, i mean that the sender dont lose coins and the receiver gets the coins
here's the script
tell me what's wrong and what i have to add or remove plzz
i need it guys ! XD
Ty
:
need you with this script , its MPOG Coins Gift Script
when some one gift a coins for example, 1 user have 20 coins
and he want to gift 10 to his friend.. it sends the coins but the 1st user still have the 20 coins and the 2nd user got 10 coins, i mean that the sender dont lose coins and the receiver gets the coins
here's the script
Code:
<?
if($_SESSION['AID'] == ""){
msgbox("Please login first.","index.php?do=login");
exit();
}
?>
<?php
if (isset($_POST['submit']))
{
if ($_POST['UserID'] == "")
{
msgbox ("Please enter a UserID.","index.php?do=gift");
}
if ($_POST['IGCoins'] == "")
{
msgbox ("Please enter a IG Coins Number.","index.php?do=gift");
}
$ip = ''.($_SERVER['REMOTE_ADDR']);
$userid = ($_POST['UserID']);
$dgcoins = ($_POST['DGCoins']);
/////////////////////////////////////////////////////
// Insuficent Coins.
$res2 = mssql_query("SELECT euCoins FROM Login WHERE AID = '".$_SESSION['AID']."'");
$acc = mssql_fetch_assoc($res2);
$result = $acc['euCoins']-$item['CashPrice'];
if($result < $dgcoins){
msgbox ("Insufficent IG Coins","index.php?do=gift");
exit();
}
// Insuficent Coins END.
////////////////////////////////////////////////////
$result1 = mssql_query("SELECT euCoins FROM Login WHERE UserID = '$useridby'");
$result2 = mssql_query("SELECT euCoins FROM Login WHERE UserID = '$userid'");
if (mssql_num_rows($result2) == 0)
{
msgbox ("Error, UserID not found.","index.php?do=gift");
return;
}
$row1 = mssql_fetch_assoc($result1);
$row2 = mssql_fetch_assoc($result2);
$coins1 = $row1['euCoins'];
$coins2 = $row2['euCoins'];
//if ($coins1 < $dgcoins)
//{
// return;
//}
$coins1 -= $dgcoins;
$coins2 += $dgcoins;
mssql_query("UPDATE [Login] SET [euCoins] = $coins1 WHERE UserID = '$useridby'");
mssql_query("UPDATE [Login] SET [euCoins] = $coins2 WHERE UserID = '$userid'");
done();
}
else gift();
?>
<?php
function gift()
{
?>
<form name="reg" method="POST" action="index.php?do=gift">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<body bgcolor="#323232">
<div align="center">
<table border="0" width="456" style="border-collapse: collapse">
<tr>
<td background="images/cont_up.png"> </td>
</tr>
<tr>
<td background="images/cont_bg.png">
<div align="center">
<table border="0" style="border-collapse: collapse" width="454" height="100%">
<tr>
<td width="3" rowspan="8"> </td>
<td colspan="2">
<img border="0" src="images/inf/gift.jpg" width="413" height="18"></td>
<td width="17"> </td>
</tr>
<tr>
<td colspan="2"><font size="1" color="#4D4D4D">The fields marked with an * are required</font> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<td width="162">·<span lang="es"> User ID<font color="#FF9933">*</font></span></td>
<td width="254"><input type="text" name="UserID" id="UserID"></td>
<td> </td>
</tr>
<tr>
<td>·<span lang="es"> IG Coins<font color="#FF9933">*</font></span></td>
<td><input type="text" name="IGCoins" id="IGCoins"></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<form name="form1" method="post" action="">
<label>
<input type="submit" name="submit" id="submit" value="Gift">
</label>
</form>
</div></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td background="images/cont_top.png" height="27"> </td>
</tr>
</table>
</div></form>
<?php
}
?>
<?php
function done()
{
$userid = ($_POST['UserID']);
$dgcoins = ($_POST['DGCoins']);
$useridby = $_SESSION['UserID'];
?>
<div align="center">
<table border="0" width="456" style="border-collapse: collapse">
<tr>
<td background="images/cont_up.png"> </td>
</tr>
<tr>
<td background="images/cont_bg.png">
<div align="center">
<table border="0" style="border-collapse: collapse" width="454" height="100%">
<tr>
<td width="3" rowspan="6"> </td>
<td colspan="2">
<img border="0" src="images/inf/gift.jpg" width="413" height="18"></td>
<td width="17"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">Thank you <?=$useridby?>, <?=$dgcoins?> IsraelGamerZ Coins has been sent to <?=$userid?> . </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
</div></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td background="images/cont_top.png" height="27"> </td>
</tr>
</table>
</div>
<?php
}
?>
tell me what's wrong and what i have to add or remove plzz
i need it guys ! XD
Ty
