Feky Posted July 15, 2009 Posted July 15, 2009 i had 2 problem with gangs names and one was with creategang.php and the other with gan_staff_name function in yourgang.php and i managed to fix the problem with creategang.php but cant figure out what i am doing wrong here so the problem is that before i messed around with the script it allowed the user to have same name gangs by leaving spaces before the gang here is the function. function gang_staff_name() { global $db, $ir, $userid, $gangdata, $h, $leaders; if(in_array($userid, $leaders)) { if(isset($_POST['subm'])) { $_POST['subm'] = trim($_POST['subm']); $check=$db->query(sprintf("SELECT `gangNAME` FROM `gangs` WHERE `gangNAME` = '%s'", clean($_POST['name']))); if($db->num_rows($check)) { print "ERROR. [url='yourgang.php?action=staff']> Back[/url]"; $h->endpage(); exit; } $sql = sprintf("UPDATE gangs SET gangNAME = '%s' WHERE (gangID = %u)", clean($_POST['vp']), $gangdata['gangID']); $db->query($sql); echo "Gang name changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { echo "Current Name: "; echo sprintf("%s ", format($gangdata['gangNAME'])); echo " <form action='yourgang.php?action=staff&act2=name' method='post'>"; echo "<input type='hidden' name='subm' value='submit' />"; echo "<table class='table' width='75%'>"; echo "<tr>"; echo "<th>New name</th>"; echo sprintf("<td style='text-align:center;'><input type='text' name='vp' value='%s' size='40%%' /></td>", format($gangdata['gangNAME'])); echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='text-align:center;'><input type='submit' value='Change' /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } } } Quote
Strats Posted July 15, 2009 Posted July 15, 2009 Re: Can someone help Please stop posting in this section. It's starting to get on my nerves Quote
Feky Posted July 15, 2009 Author Posted July 15, 2009 Re: Can someone help Please stop posting in this section. It's starting to get on my nerves ok sorry Quote
fbiss Posted July 16, 2009 Posted July 16, 2009 Re: Can someone help Feky, you have been warned before. This is not the proper section to request mods or ask for help. 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.