blankextacy Posted December 31, 2006 Share Posted December 31, 2006 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] Quote Link to comment Share on other sites More sharing options...
Tandem Posted December 31, 2006 Share Posted December 31, 2006 I think you need to explain it a bit better. You can't expect everyone to know how your game works or what a "crew vault" is... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.