[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    [CGI] question from a new learner
From:       Fong-Chih Chen <fcchen () fcc ! u-net ! com>
Date:       1998-06-26 12:27:54
[Download RAW message or body]

Hi! Dear friends,

This question may sound stupid. I hope someone can give me help. 
My problem is as follows:

I found someone posted many blanks to destroy my wwwboard. 

# When I use:

if ($FORM{'body'} eq ' ') {
      &error(no_body);
   }

# It doesn't work when people type more than one blank

# When I use:

      @blanks=(' ');
      foreach $item (@blanks){
      $FORM{'body'}=~s/$item//g
}

# It will delete all blanks, for example,
1. "It doesn't work when people" become "Itdoesn'tworkwhenpeople"';
2. "                 I am" become "Iam";
3. When people just typed blanks and didn't include any letters, they will 
get "Error: No Body". 

My question is how can I let people get "Error: No Body" when they just 
type one or more blanks. In addition, when people type "It doesn't work 
when people" can normally as "It doesn't work when people".
Your any help would be very appreciated. 

Best wishes.

Fong-Chih Chen



-----------------------------------------------------------------
For subscription information, http://www.jann.com/lwgate/lwgate.pl/CGI-LIST/.

The CGI Tips & Tricks website (and archive of the list) is located
at http://www.jann.com/Perl/

cgi-list is hosted by Wizards of the Web (http://wizweb.com).
-----------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic