Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 surveying the Monastery: (4)
As of 2016-10-23 15:39 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.