Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by astaines (Curate)
on Jul 14, 2002 at 17:56 UTC ( [id://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/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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181613]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found