Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Checking for empty CGI params; this isn't working

by astaines (Curate)
on Jul 14, 2002 at 17:56 UTC ( #181613=note: print w/ replies, xml ) Need Help??


in reply to Checking for empty CGI params; this isn't working

You're checking the truth-value of the 'length' of an 'or' of two calls to 'param()' - this is probably not what you meant (-;

elsif ( (length(param('tele') > 0) or (length(param('mobile') > 0) )

might be closer to your intentions. Any views on optimum indentation style for code readability?


--
Anthony Staines


Comment on Re: Checking for empty CGI params; this isn't working
Download Code
Re: Re: Checking for empty CGI params; this isn't working
by andrew (Acolyte) on Jul 14, 2002 at 18:01 UTC
    syntax error at /var/securewww/virtual/webewebin.com/a/signup.cgi line + 61, near ") {" syntax error at /var/securewww/virtual/webewebin.com/a/signup.cgi line + 76, near "}" (Might be a runaway multi-line ~~ string starting on line 73) Execution of /var/securewww/virtual/webewebin.com/a/signup.cgi aborted + due to compilation errors.
    I get that error from
    elsif ((length(param('tele') > 0) || (length(param('mobile') > 0)) { error("You need to enter either a telephone or a mobile"); }
    </code>

      elsif ( (length(param('tele')) > 0) || (length(param('mobile')) > 0) ) { .. }
      you've simply missed a brace each after 'tele' and 'mobile' :-)

      Have a nice day
      All decision is left to your taste

        this is what happens, when I dont enter anything in both I pass, but if I do enter something I get the error, how is it backwords

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://181613]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-25 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls