Jump to content

help


blankextacy

Recommended Posts

hey, i am working on a game and trying to make it so it shows the items you won from a attack in your crew vault but in if ($_GET['item']) { there is $user[FIELD] i cannot figure out how to carry that to if ($action == 'awarditem') { so the script can give the player the item.
[code]
<? $title = "Crew Vault"; include("header.php");
print"<center>";
print"<table width=100% class=stattabletitle>

<tr width=100%>

<td><b>Crew Vault</b></td>

</tr>
</table>

<table width=100% cellpadding=0 cellspacing=0>

";


$vault1 = mysql_query("select * from items WHERE crew=$stat[crewid] order by attack desc limit 50");
while ($vault = mysql_fetch_array($vault1)) {
print "<span onMouseover=\"ddrivetip('<center>$vault[name]<br>Attack: $vault[attack]<br>HP: $vault[hp]<br>Exp Per Turn:

$vault[ept]<br>Rage Per Turn: $vault[rpt]<br>Income: $vault[mpt]<br></center>','#666666', 125)\";
onMouseout=\"hideddrivetip()\"><a href=crewvault.php?item=$vault[id]><img src=$vault[img] width=50 height=50></a></span><br>
";


}


print"</table>";

print"</center>";



if ($_GET['item']) {

print"<form method=post action=crewvault.php?action=awarditem&item=$item[id]";
print"<select name=user>";
$user = mysql_query("select * from users WHERE crewid=$stat[crewid]");
while ($users = mysql_fetch_array($user)) {
print"<option value=$users[id]>$users[name]</option>";

}

print"</select>";
print"<input type=submit class=submit value=Award>";
}
if ($action == 'awarditem') {


mysql_query("update `items` set `owner` = '$user[id]' and `crew` = '0' where `id` = '$item[id]'");
echo mysql_error();
print"<center>You have awarded $user[name] with $item[name].</center>";

}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.