CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
EASY - case sensitive and punctuation

 



Zeke_D
Deleted

Oct 12, 2000, 9:26 PM

Post #1 of 2 (418 views)
EASY - case sensitive and punctuation Can't Post

The following code is case-sensitive. I would like it to not be (so i dont have two people registered as NICK and nick) also I would like to disallow punctuation and symbols.

I know you guys can help me....

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>



if ($name eq "") {
$founderror = 1 ;
$message .= "<B>Please enter a name.</B><BR>\n";
}
else {
open ("USERNAMES", "$dataurl/snippet.user");
@username = <USERNAMES>;
foreach (@username) {
($xuser) = split ('[|]',$_);
if ($xuser eq $user) {
$founderror = 1 ;
$message .= "<B>Username already in use.</B><BR>\n";
}
}
close (USERNAMES);
}

</pre><HR></BLOCKQUOTE>

[This message has been edited by Zeke_D (edited 10-12-2000).]

[This message has been edited by Zeke_D (edited 10-12-2000).]


LeoF
Novice

Oct 13, 2000, 10:43 AM

Post #2 of 2 (418 views)
Re: EASY - case sensitive and punctuation [In reply to] Can't Post

Hi Zeke_D,

To avoid case sentitivity change:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

if ($xuser eq $user) {</pre><HR></BLOCKQUOTE>

to:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

if (lc($xuser) eq lc($user)) {</pre><HR></BLOCKQUOTE>

Hope that helps

Be Well

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives