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
https://forums.phpfreaks.com/topic/32370-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.