Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

Replies are listed 'Best First'.
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/ line + 61, near ") {" syntax error at /var/securewww/virtual/ line + 76, near "}" (Might be a runaway multi-line ~~ string starting on line 73) Execution of /var/securewww/virtual/ 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"); }

      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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2020-07-08 11:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found