Jump to content

[SOLVED] Need help modifying function?


darkfreaks

Recommended Posts

alrite so how would i go about changing the following code to include a dropdown? right now it works so that you can only give one item to a user but i want it to work with my dropdown so that if they select a number from the dropdown it will give the user that many items.

 

 

 

<?php

/*
Process Award Items (admin_give_item.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$findItem = fetch("SELECT id,parts,item_name FROM items2 WHERE item_name = '$award_itemname' AND game = '$game'");
if (!$findItem[id])
{
die(header("Location: admin_give_item.php?game=$game&error=There+is+no+such+item+as+a+$award_itemname,+please+try+again."));
}
$award_to = strtolower(ereg_replace(" ", "", $award_to));
$findUser = fetch("SELECT id,display_name FROM members2 WHERE username = '$award_to' AND game = '$game'");
if (!$findUser[id])
{
die(header("Location: admin_give_item.php?game=$game&error=There+is+no+such+user+as+a+$award_to,+please+try+again."));
}

mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$findUser[id]','$findItem[id]','$findItem[parts]','$game')"); ///insert item into users item list

$errorMessage = "You+have+given+$findUser[display_name]+a+$findItem[item_name]!";

systemmessage("$game", "myitems.php?game=$game", "$findUser[id]", "The Willo the Wisp has given you a $findItem[item_name]!");

header("Location: admin_give_item.php?game=$game&error=$errorMessage");

?>



Link to comment
https://forums.phpfreaks.com/topic/106399-solved-need-help-modifying-function/
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.