Strats Posted July 10, 2009 Posted July 10, 2009 Ages ago I added Edit item type to my game and it worked fine, Now I go to do it it says requires action. Also does the same thing when I click Delete item type. So I'm guessing I deleted the action bit. Can someone tell me it? Or put it in for me please. It was right after add item type function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } function mass_give_item() { global $db,$ir,$c; print "<h3>Giving Item To All Users</h3> <form action='staff_items.php?action=massitemgivesub' method='post'> Item: ".item_dropdown($c,'item')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Mass Send' /></form>"; } function mass_give_item_sub() { global $db,$ir,$c; $q=mysql_query("SELECT * FROM users WHERE fedjail=0",$c); while($r=mysql_fetch_array($q)) { $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$r['userid']},{$_POST['qty']})",$c) or die(mysql_error()); event_add($r['userid'],"The popliation has just bin given an item {$_POST['item']}, Click [url='inventory.php']Here[/url] to check.",$c); print "Item Sent To {$r['username']}</br>"; } print " Mass item sending complete!</br> Theres no need to send a mass mail because they just got an event."; } $h->endpage(); ?> Quote
AlabamaHit Posted July 10, 2009 Posted July 10, 2009 Re: Edit Item type - Delete Item type That code don't help for that.. But what it sounds like is your links are linking ot the wrong funcitons. unknown, or no function is the only reason to get that script requires action. As that is the default. Hope this helps. Quote
Strats Posted July 10, 2009 Author Posted July 10, 2009 Re: Edit Item type - Delete Item type Thanks I will check it out in the morning or post the full file Quote
Voice4Vision Posted July 10, 2009 Posted July 10, 2009 Re: Edit Item type - Delete Item type Here you go Strats. http://criminalexistence.com/ceforums/i ... ic=23095.0 Oddly enough, I noticed yesterday mine was no longer working. Lo' and behold, it turns out that the edits were missing, I also added this a while ago, and fully tested. Either way, I think what I might have done was uploaded an older backup when I was messing around with it for something else. Good Luck! :wink: Quote
CrazyT Posted July 11, 2009 Posted July 11, 2009 Re: Edit Item type - Delete Item type function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } <?php //remove when adding. o.o function newitemtype() { global $h, $ir, $db; if($ir['user_level'] != 2) { echo 'Invalid Access!'; exit($h->endpage()); } echo '<h3>Add Item Type</h3>'; if(isset($_POST['name'])) { if(empty($_POST['name'])) { echo '<span style="color: red; font-weight: bold;">Error - </span>No name was entered. '; } else { $_POST['name'] = $db->escape($_POST['name']); $db->query("INSERT INTO `itemtypes` VALUES(NULL, '{$_POST['name']}')"); echo 'Item Type '. stripslashes($_POST['name']) .' added.'; stafflog_add('Added item type '. $_POST['name']); } } echo '<form action="staff_items.php?action=newitemtype" method="POST" />'. 'Name: <input type="text" name="name" /> '. '<input type='submit' value="Add Item Type" /></form>'; } Use this one instead of your one XD. Quote
Strats Posted July 11, 2009 Author Posted July 11, 2009 Re: Edit Item type - Delete Item type Here you go Strats. http://criminalexistence.com/ceforums/i ... ic=23095.0 Oddly enough, I noticed yesterday mine was no longer working. Lo' and behold, it turns out that the edits were missing, I also added this a while ago, and fully tested. Either way, I think what I might have done was uploaded an older backup when I was messing around with it for something else. Good Luck! :wink: This is what I needed thanks, I had added this before but for some reason I had changed the items page and forgot to put it back Quote
Voice4Vision Posted July 11, 2009 Posted July 11, 2009 Re: Edit Item type - Delete Item type I am glad I could help. But I am also glad you discovered you had the problem...because there's no telling how long it would be before I would have discovered mine. My site is no where near being complete, and with me working on one file at a time to completion with mods and custom modifications, it gets rather challenging with what's done and what's not. Quote
Strats Posted July 11, 2009 Author Posted July 11, 2009 Re: Edit Item type - Delete Item type I opened my site to a small handfull of people when I was at the end on finishing it, I wanted peoples idea on how I could make it better and have people watching for bugs Quote
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.