Undergroundcity Posted December 27, 2008 Posted December 27, 2008 This is a very small and simple mod I just put together. You can disallow usernames. It is perfect if you want to reserve a name, or block swears. First, edit register.php and add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. At the top of the page. Then, add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Under: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Keep adding the variables to ban more usernames. As I said this is a very simple mod so please don't leave annoying posts ;) Quote
Haunted Dawg Posted December 27, 2008 Posted December 27, 2008 Re: [Any Mccode] Disallow Username xD. How low can people go. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Undergroundcity Posted December 27, 2008 Author Posted December 27, 2008 Re: [Any Mccode] Disallow Username xD. How low can people go. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. There is really no difference.... an array is just a simple way to store varaibles. Quote
Haunted Dawg Posted December 27, 2008 Posted December 27, 2008 Re: [Any Mccode] Disallow Username 2 Error's on your's. $banned = username => missing a ; if ($_POST['username'] = ['$banned']) => should be == and not = plus your missing the { & } since it is calling else after that. Mine will work way much better than your's. Quote
John99 Posted December 27, 2008 Posted December 27, 2008 Re: [Any Mccode] Disallow Username Yeah killahs right his was will be better :) and in bannded usernames why not make a sql for it and admin function so u can add them insted of keep opening register.php 2 add them ? Quote
POG1 Posted December 27, 2008 Posted December 27, 2008 Re: [Any Mccode] Disallow Username It would make sense to add it into a function because it will be used throughout the website. Killah's version is pretty much the simplest way to do it. ;) checkUsername($username) { $blocked = ( dave, bob, steve, georgina, linda ); if(!in_array($username, $blocked)) { return FALSE; } else { return TRUE; } } if(!checkUsername($username)) { echo 'oops!'; die; } 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.