|
| Author |
Message |
mathieu2005 Young One

Joined: 23 Dec 2004 Posts: 76
  
|
Posted: Sun Feb 20, 2005 3:11 pm Post subject: |
|
|
i want two admin but like my $admin = 'mathieu3037@hotmail.com'; how i do for add an other admin i try my $admin = 'mathieu3037@hotmail.com' & 'an other adress'; but doesnt work plz help me |
|
| Back to top |
|
 |
Dazzy Agent

Joined: 09 Jan 2004 Posts: 1731
 
|
Posted: Sun Feb 20, 2005 3:14 pm Post subject: |
|
|
| You cant add another value to a varible, either chose a new varible or make it into an array and then check in loops? |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Sun Feb 20, 2005 3:55 pm Post subject: |
|
|
| Code: | | my @admins = ('address@email.com', 'youcan@notcodeperl.com');<br /><br />###<br /><br />sub isAdmin<br />{<br />my $person = shift;<br /><br />foreach my $admins (@admins)<br />{<br /><br />if ($person eq $admins){ return 1; }<br />return 0;<br />}<br />}<br />1;<br /><br />###<br /><br />if (isAdmin($username))<br />{<br />print "You are an admin";<br />}<br />else<br />{<br />print "You are not an admin";<br />} |
_________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
|
| Back to top |
|
 |
|