Jump to content
MakeWebGames

Recommended Posts

Posted

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 ;)

Posted

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.

Posted

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 ?

Posted

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;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...