diallowing names

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Bob42
Posts: 1
Joined: Tue May 08, 2007 12:04 am

diallowing names

Post by Bob42 »

Script URL:
Version of script: 1.5
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: disallowing names

Write your message below:

Hi,
Is it possible to disallow certain names that can be used when a person signs the guestbook? I'm hoping there's an addon that will let me do this.
Thanks.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

You'd need to add something like this to the settings.php file:

Code: Select all

$settings['ban_names']=array(
'your name',
'john doe',
'some name',
);
. Make sure all names are in lower-case and NOT UPPER-CASE.

Then in gbook.php just ABOVE line 92

Code: Select all

if (empty($name))
add this:

Code: Select all

if (in_array(strtolower($name),$settings['ban_names'])) {
	printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Banned name');
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply