Jump to content

[SOLVED] Won't let me choose..


Bullet

Recommended Posts

The main code (PHP script):

 

    if ($_POST['weapon']){

$equipment_weapon = strip_tags($_POST['equipment_weapon']);
$info = mysql_fetch_object(mysql_query("SELECT * FROM `inventory` WHERE `id` = '".$equipment_weapon."'"));

if (!$equipment_weapon){
echo "<br><center><f>You must choose which weapon to use!</f></center>";
}elseif ($equipment_weapon){

$check_for_oc = mysql_num_rows(mysql_query("SELECT * FROM `oc` WHERE `leader` = '".$fetch->username."'"));

if (($fetch->oc == "0") && ($check_for_oc == "0")){
echo "<br><center><f>You are not in an Organised Crime to buy equipment for!</f></center>";
}elseif (($fetch->oc != "0") && ($check_for_oc != "0")){


mysql_query("UPDATE `oc` SET `weaponsequip` = '".$info->name."', `weaponsstatus` = 'Ready' WHERE `leader` = '".$fetch->currentoc."'");
mysql_query("DELETE FROM `inventory` WHERE `id` = '".$equipment_weapon."'");

echo "<br><center><s>The $info->name is now being used as the weapon for the Organized Crime!</s></center>";

 

HTML:

                            </tr><tr>                            <?php

 

$garage_query = mysql_query("SELECT * FROM `inventory` WHERE `username` = '".$username."' AND `type` = 'Weapon' ORDER BY `id`");

 

$garage_num = mysql_num_rows($garage_query);

 

if ($garage_num == "0"){ echo "<td bgcolor=\"#2c2c2c\" colspan=\"3\" align=\"center\">You have no weapons.</td></tr>"; }

 

while($garage_fetch = mysql_fetch_object($garage_query)){

 

echo "<td bgcolor=\"#2c2c2c\"><input name=\"equipment_weapon\" type=\"radio\" value=\"$garage_fetch->id\"></td>

<td bgcolor=\"#2c2c2c\">$garage_fetch->name</td>

</tr>";

} ?>

                            <tr align="left" bgcolor="#2c2c2c">

                            <td colspan="5" align="center"><input name="weapon" type="submit" id="weapon" value="Use!" title="Use this house!" class="button"></td>

 

 

Anyone know why I can't select the weapon? It just refreshes, help?

 

 

Link to comment
https://forums.phpfreaks.com/topic/120794-solved-wont-let-me-choose/
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.